Programming

{"content":{"id":1274,"title":"Daily Link","body":"\u003cp\u003e\r\nSomeone made an unbelievably-beautiful \u003ca href=\"https://www.jwz.org/blog/2020/02/evoboxx-life-synthesizer/\"\u003eConway's Game of Life machine\u003c/a\u003e.\r\n\u003c/p\u003e","publication_date":"2020-04-04T12:00:00.000Z","created_at":"2020-03-29T21:51:23.000Z","updated_at":"2020-03-29T21:51:40.000Z","user_id":1,"rating":null},"tags":"\u003ca class=\"changeable-title\" href=\"/q?tag=daily_links\"\u003edaily_links\u003c/a\u003e \u003ca class=\"changeable-title\" href=\"/q?tag=programming\"\u003eprogramming\u003c/a\u003e \u003ca class=\"changeable-title\" href=\"/q?tag=design\"\u003edesign\u003c/a\u003e \u003ca class=\"changeable-title\" href=\"/q?tag=games\"\u003egames\u003c/a\u003e"}

Daily Link

Someone made an unbelievably-beautiful Conway's Game of Life machine.

{"content":{"id":1132,"title":"Daily Link","body":"\u003cp\u003e\r\nIn CSS, easing is \u003ca href=\"https://kilianvalkhof.com/2020/css-html/using-easing-for-more-than-just-css-transitions/\"\u003enot just for transitions\u003c/a\u003e.\r\n\u003c/p\u003e","publication_date":"2020-02-21T12:00:00.000Z","created_at":"2020-02-19T01:39:49.000Z","updated_at":"2020-02-19T01:39:49.000Z","user_id":1,"rating":null},"tags":"\u003ca class=\"changeable-title\" href=\"/q?tag=programming\"\u003eprogramming\u003c/a\u003e \u003ca class=\"changeable-title\" href=\"/q?tag=css\"\u003ecss\u003c/a\u003e \u003ca class=\"changeable-title\" href=\"/q?tag=design\"\u003edesign\u003c/a\u003e"}

Daily Link

In CSS, easing is not just for transitions.

{"content":{"id":1130,"title":"Daily Links","body":"\u003cp\u003e\r\nVery interesting \u003ca href=\"https://drewdevault.com/2020/01/04/Slow.html\"\u003esize/speed/system call\u003c/a\u003e benchmarks for 'Hello World' in a number of languages. 'Hello World' might seem trivial and non-comprehensive, but the results are extremely surprising and enlightening.\r\n\u003c/p\u003e","publication_date":"2020-02-19T12:00:00.000Z","created_at":"2020-02-19T01:35:13.000Z","updated_at":"2020-02-19T17:26:07.000Z","user_id":1,"rating":null},"tags":"\u003ca class=\"changeable-title\" href=\"/q?tag=daily_links\"\u003edaily_links\u003c/a\u003e \u003ca class=\"changeable-title\" href=\"/q?tag=programming\"\u003eprogramming\u003c/a\u003e"}

Daily Links

Very interesting size/speed/system call benchmarks for 'Hello World' in a number of languages. 'Hello World' might seem trivial and non-comprehensive, but the results are extremely surprising and enlightening.

{"content":{"id":1124,"title":"Daily Link","body":"\u003cp\u003e\r\n\u003ca href=\"https://github.com/s-macke/VoxelSpace\"\u003eVoxel Space\u003c/a\u003e: an interesting article about a major leap in 90s computer graphics. Lots of pretty pictures to help demonstrate.\r\n\u003c/p\u003e","publication_date":"2020-02-17T12:00:00.000Z","created_at":"2020-02-16T20:07:56.000Z","updated_at":"2020-02-16T20:08:06.000Z","user_id":1,"rating":null},"tags":"\u003ca class=\"changeable-title\" href=\"/q?tag=daily_links\"\u003edaily_links\u003c/a\u003e \u003ca class=\"changeable-title\" href=\"/q?tag=programming\"\u003eprogramming\u003c/a\u003e \u003ca class=\"changeable-title\" href=\"/q?tag=python\"\u003epython\u003c/a\u003e"}

Daily Link

Voxel Space: an interesting article about a major leap in 90s computer graphics. Lots of pretty pictures to help demonstrate.

{"content":{"id":1121,"title":"Daily Link","body":"\u003cp\u003e\r\nI talked about De Stijl yesterday. Piet is a programming language \u003ca href=\"https://www.dangermouse.net/esoteric/piet/samples.html\"\u003ewhose programs can look like De Stijl paintings\u003c/a\u003e, although you can see from the samples that people have created all kinds of patterns, like the giant red circle that calculates an approximation of Pi, or the 'Hello World' that looks like the world.\r\n\u003c/p\u003e","publication_date":"2020-02-15T12:00:00.000Z","created_at":"2020-02-14T23:16:00.000Z","updated_at":"2020-02-15T12:25:09.000Z","user_id":1,"rating":null},"tags":"\u003ca class=\"changeable-title\" href=\"/q?tag=daily_links\"\u003edaily_links\u003c/a\u003e \u003ca class=\"changeable-title\" href=\"/q?tag=programming\"\u003eprogramming\u003c/a\u003e \u003ca class=\"changeable-title\" href=\"/q?tag=netherlands\"\u003enetherlands\u003c/a\u003e \u003ca class=\"changeable-title\" href=\"/q?tag=twentieth_century\"\u003etwentieth_century\u003c/a\u003e \u003ca class=\"changeable-title\" href=\"/q?tag=de_stijl\"\u003ede_stijl\u003c/a\u003e \u003ca class=\"changeable-title\" href=\"/q?tag=painting\"\u003epainting\u003c/a\u003e"}

Daily Link

I talked about De Stijl yesterday. Piet is a programming language whose programs can look like De Stijl paintings, although you can see from the samples that people have created all kinds of patterns, like the giant red circle that calculates an approximation of Pi, or the 'Hello World' that looks like the world.

{"content":{"id":1117,"title":"Daily Link: Banwhich","body":"\u003cp\u003e\r\n\u003ca href=\"https://github.com/imsnif/bandwhich\"\u003eBetter network usage visualization for the console\u003c/a\u003e\r\n\u003c/p\u003e","publication_date":"2020-02-13T12:00:00.000Z","created_at":"2020-02-12T20:16:42.000Z","updated_at":"2020-02-14T00:25:51.000Z","user_id":1,"rating":null},"tags":"\u003ca class=\"changeable-title\" href=\"/q?tag=daily_links\"\u003edaily_links\u003c/a\u003e \u003ca class=\"changeable-title\" href=\"/q?tag=programming\"\u003eprogramming\u003c/a\u003e \u003ca class=\"changeable-title\" href=\"/q?tag=programs\"\u003eprograms\u003c/a\u003e"}

Daily Link: Banwhich

{"content":{"id":1108,"title":"Daily Link: Lazy Enumerators In Ruby","body":"\u003cp\u003e\r\n\u003ca href=\"https://blog.saeloun.com/2019/10/23/ruby-lazy-enumerators.html\"\u003eFun with Ruby\u003c/a\u003e\r\n\u003c/p\u003e","publication_date":"2020-02-09T12:00:00.000Z","created_at":"2020-02-05T22:16:21.000Z","updated_at":"2020-02-05T22:16:21.000Z","user_id":1,"rating":null},"tags":"\u003ca class=\"changeable-title\" href=\"/q?tag=programming\"\u003eprogramming\u003c/a\u003e \u003ca class=\"changeable-title\" href=\"/q?tag=ruby\"\u003eruby\u003c/a\u003e \u003ca class=\"changeable-title\" href=\"/q?tag=daily_links\"\u003edaily_links\u003c/a\u003e"}

Daily Link: Lazy Enumerators In Ruby

{"content":{"id":1076,"title":"Weekly Links - Oh Lord Don't Let Them Drop That Atomic Bomb on Me Edition","body":"\u003cul\u003e\r\n\u003cli\u003e\r\nRemember when Rosanne got Tom Arnold his own show? \u003ca href=\"https://youtu.be/8Q18uKadksk\"\u003eA very tongue-in-cheek ad\u003c/a\u003e for the show, followed by Stephen King advertising the new Dark Tower book. \r\n\u003c/li\u003e\r\n\u003cli\u003e\r\nA Tumblr entirely dedicated to \u003ca href=\"https://antiriker.tumblr.com/\"\u003eanti-Riker memes\u003c/a\u003e. Reading it through, I get the feeling that the maintainer doesn't actually hate Riker at all!\r\n\u003c/li\u003e\r\n\u003cli\u003e\r\nOn a related note, what are the chances that the new Picard show's secret plot twist is time travel and/or time travelling into the other timeline's past? Star Trek's last non-prequel was eighteen years ago and they've now got countless prequels-to-prequels. They seem pretty committed to being prequel-only at this point.\r\n\u003c/li\u003e\r\n\u003cli\u003e\r\nIn my opinion, the greatest - or at least greatest looking - web comic of all time is \u003ca href=\"https://www.alessonislearned.com/\"\u003eA Lesson Is Learned But The Damage Is Irreversible\u003c/a\u003e, which was active in the 00s. The illustrator later did the artwork for the game Braid.\r\n\u003c/li\u003e\r\n\u003cli\u003e\r\nSome extremely brave scientists in India blog about \u003ca href=\"https://pogirigowrishankar.wordpress.com/2011/04/24/king-cobra-nests/\"\u003eresearching King Cobra nests\u003c/a\u003e.\r\n\u003c/li\u003e\r\n\u003cli\u003e\r\n\u003ca href=\"https://www.lysator.liu.se/c/ten-commandments.html\"\u003eThe Ten C Commandments\u003c/a\u003e. Not to be confused with the Biggie Smalls song.\r\n\u003c/li\u003e\r\n\u003c/ul\u003e","publication_date":"2020-01-06T00:00:00.000Z","created_at":"2020-01-05T18:15:57.000Z","updated_at":"2020-01-05T18:22:47.000Z","user_id":1,"rating":null},"tags":"\u003ca class=\"changeable-title\" href=\"/q?tag=books\"\u003ebooks\u003c/a\u003e \u003ca class=\"changeable-title\" href=\"/q?tag=scary\"\u003escary\u003c/a\u003e \u003ca class=\"changeable-title\" href=\"/q?tag=weekly_links\"\u003eweekly_links\u003c/a\u003e \u003ca class=\"changeable-title\" href=\"/q?tag=tv\"\u003etv\u003c/a\u003e \u003ca class=\"changeable-title\" href=\"/q?tag=sitcoms\"\u003esitcoms\u003c/a\u003e \u003ca class=\"changeable-title\" href=\"/q?tag=star_trek\"\u003estar_trek\u003c/a\u003e \u003ca class=\"changeable-title\" href=\"/q?tag=tng\"\u003etng\u003c/a\u003e \u003ca class=\"changeable-title\" href=\"/q?tag=old_memes\"\u003eold_memes\u003c/a\u003e \u003ca class=\"changeable-title\" href=\"/q?tag=games\"\u003egames\u003c/a\u003e \u003ca class=\"changeable-title\" href=\"/q?tag=old_comics\"\u003eold_comics\u003c/a\u003e \u003ca class=\"changeable-title\" href=\"/q?tag=the_zeroes\"\u003ethe_zeroes\u003c/a\u003e \u003ca class=\"changeable-title\" href=\"/q?tag=snakes\"\u003esnakes\u003c/a\u003e \u003ca class=\"changeable-title\" href=\"/q?tag=animals\"\u003eanimals\u003c/a\u003e \u003ca class=\"changeable-title\" href=\"/q?tag=programming\"\u003eprogramming\u003c/a\u003e \u003ca class=\"changeable-title\" href=\"/q?tag=c\"\u003ec\u003c/a\u003e"}

Weekly Links - Oh Lord Don't Let Them Drop That Atomic Bomb on Me Edition

  • Remember when Rosanne got Tom Arnold his own show? A very tongue-in-cheek ad for the show, followed by Stephen King advertising the new Dark Tower book.
  • A Tumblr entirely dedicated to anti-Riker memes. Reading it through, I get the feeling that the maintainer doesn't actually hate Riker at all!
  • On a related note, what are the chances that the new Picard show's secret plot twist is time travel and/or time travelling into the other timeline's past? Star Trek's last non-prequel was eighteen years ago and they've now got countless prequels-to-prequels. They seem pretty committed to being prequel-only at this point.
  • In my opinion, the greatest - or at least greatest looking - web comic of all time is A Lesson Is Learned But The Damage Is Irreversible, which was active in the 00s. The illustrator later did the artwork for the game Braid.
  • Some extremely brave scientists in India blog about researching King Cobra nests.
  • The Ten C Commandments. Not to be confused with the Biggie Smalls song.
{"content":{"id":1058,"title":"'Build Your Own Lisp' Solutions: 6.6","body":"\u003cp\u003e\u003cb\u003eQ:\u003c/b\u003e Change the grammar to recognize decimal numbers such as 0.01, 5.21, or 10.2.\u003c/p\u003e\r\n\u003cp\u003e\u003cb\u003eA:\u003c/b\u003e \r\n\u003cpre\u003e\u003ccode class=\"cpp\"\u003e\" \\\r\nnumber : /-?[0-9]+(.[0-9]+)*/ ; \\\r\noperator : 'add' | 'sub' | 'mul' | 'div'; \\\r\nexpr : \u0026lt;number\u003e | '(' \u0026lt;operator\u003e \u0026lt;expr\u003e+ ')' ; \\\r\nlispy : /^/ \u0026lt;operator\u003e \u0026lt;expr\u003e+ /$/ ; \\\r\n\"\u003c/code\u003e\u003c/pre\u003e\r\n\u003c/p\u003e","publication_date":"2020-01-04T00:00:00.000Z","created_at":"2019-12-10T00:09:33.000Z","updated_at":"2020-07-06T19:13:57.000Z","user_id":1,"rating":null},"tags":"\u003ca class=\"changeable-title\" href=\"/q?tag=c\"\u003ec\u003c/a\u003e \u003ca class=\"changeable-title\" href=\"/q?tag=lisp\"\u003elisp\u003c/a\u003e \u003ca class=\"changeable-title\" href=\"/q?tag=build_your_own_lisp\"\u003ebuild_your_own_lisp\u003c/a\u003e \u003ca class=\"changeable-title\" href=\"/q?tag=answers\"\u003eanswers\u003c/a\u003e \u003ca class=\"changeable-title\" href=\"/q?tag=programming\"\u003eprogramming\u003c/a\u003e"}

'Build Your Own Lisp' Solutions: 6.6

Q: Change the grammar to recognize decimal numbers such as 0.01, 5.21, or 10.2.

A:

"                                                   \
number   : /-?[0-9]+(.[0-9]+)*/ ;                   \
operator : 'add' | 'sub' | 'mul' | 'div';           \
expr     : <number> | '(' <operator> <expr>+ ')' ;  \
lispy    : /^/ <operator> <expr>+ /$/ ;             \
"

{"content":{"id":1062,"title":"Weekly Links","body":"\u003cul\u003e\r\n\u003cli\u003e\r\nTerence Tao: \u003ca href=\"https://arxiv.org/abs/1909.03562\"\u003eAlmost all orbits of the Collatz map attain almost bounded values\u003c/a\u003e. I only made it a few pages in, but I feel privileged to share the same universe as this guy, and that conjecture.\r\n\u003c/li\u003e\r\n\u003cli\u003e\r\n\u003ca href=\"http://www.weirduniverse.net/blog/comments/weirdo_the_cat_killing_superchicken\"\u003eWeirdo the cat-killing superchicken\u003c/a\u003e.\r\n\u003c/li\u003e\r\n\u003cli\u003e\r\nSandi Metz, who is an excelling programming writer, once came up with \u003ca href=\"https://thoughtbot.com/blog/sandi-metz-rules-for-developers\"\u003efour rules\u003c/a\u003e for object-oriented programming. I've been more-or-less trying to stick to them for a while now. Good or not good?\r\n\u003c/li\u003e\r\n\u003cli\u003e\r\nI'm obsessed with movies that can be edited down to \u003ca href=\"https://sananab.ca/q?reverse=true\u0026tag=perfect_edits\"\u003eless than three minutes\u003c/a\u003e without losing any plot points or characterization. Someone managed do the same to \u003ca href=\"https://youtu.be/uh02zvHHPzw\"\u003ethe entire run of the Sopranos\u003c/a\u003e.\r\n\u003c/li\u003e\r\n\u003cli\u003e\r\n\u003ca href=\"https://uproxx.com/movies/tom-hanks-interesting-things/\"\u003eTom Hanks MegaFacts\u003c/a\u003e. Includes him rapping while doing a Harry Morgan impression??\r\n\u003c/li\u003e\r\n\u003cli\u003e\r\nJohn Waters has been releasing a list of his \u003ca href=\"https://www.artforum.com/contributor/john-waters\"\u003efavourite movies of the year\u003c/a\u003e every year for two decades. Watching these is a new life goal.\r\n\u003c/li\u003e\r\n\u003c/ul\u003e","publication_date":"2019-12-15T00:00:00.000Z","created_at":"2019-12-14T18:43:21.000Z","updated_at":"2019-12-16T00:21:55.000Z","user_id":1,"rating":null},"tags":"\u003ca class=\"changeable-title\" href=\"/q?tag=weekly_links\"\u003eweekly_links\u003c/a\u003e \u003ca class=\"changeable-title\" href=\"/q?tag=mathematics\"\u003emathematics\u003c/a\u003e \u003ca class=\"changeable-title\" href=\"/q?tag=programming\"\u003eprogramming\u003c/a\u003e \u003ca class=\"changeable-title\" href=\"/q?tag=perfect_edits\"\u003eperfect_edits\u003c/a\u003e \u003ca class=\"changeable-title\" href=\"/q?tag=tv\"\u003etv\u003c/a\u003e \u003ca class=\"changeable-title\" href=\"/q?tag=overrated\"\u003eoverrated\u003c/a\u003e \u003ca class=\"changeable-title\" href=\"/q?tag=food\"\u003efood\u003c/a\u003e \u003ca class=\"changeable-title\" href=\"/q?tag=movies\"\u003emovies\u003c/a\u003e"}

Weekly Links

{"content":{"id":1023,"title":"'Build Your Own Lisp' Solutions: 6.5","body":"\u003cp\u003e\u003cb\u003eQ:\u003c/b\u003e › Change the grammar to recognise operators written in textual format 'add', 'sub', 'mul', 'div'.\u003c/p\u003e\r\n\u003cbr\u003e\r\n\u003cp\u003e\u003cb\u003eA:\u003c/b\u003e \r\n\u003cpre\u003e\u003ccode class=\"cpp\"\u003e\" \\\r\nnumber : /-?[0-9]+/ ; \\\r\noperator : 'add' | 'sub' | 'mul' | 'div'; \\\r\nexpr : \u0026lt;number\u003e | '(' \u0026lt;operator\u003e \u0026lt;expr\u003e+ ')' ; \\\r\nlispy : /^/ \u0026lt;operator\u003e \u0026lt;expr\u003e+ /$/ ; \\\r\n\"\u003c/code\u003e\u003c/pre\u003e\r\n\u003c/p\u003e","publication_date":"2019-12-04T00:00:00.000Z","created_at":"2019-11-04T20:51:40.000Z","updated_at":"2019-11-04T21:00:09.000Z","user_id":1,"rating":null},"tags":"\u003ca class=\"changeable-title\" href=\"/q?tag=c\"\u003ec\u003c/a\u003e \u003ca class=\"changeable-title\" href=\"/q?tag=lisp\"\u003elisp\u003c/a\u003e \u003ca class=\"changeable-title\" href=\"/q?tag=build_your_own_lisp\"\u003ebuild_your_own_lisp\u003c/a\u003e \u003ca class=\"changeable-title\" href=\"/q?tag=answers\"\u003eanswers\u003c/a\u003e \u003ca class=\"changeable-title\" href=\"/q?tag=programming\"\u003eprogramming\u003c/a\u003e"}

'Build Your Own Lisp' Solutions: 6.5

Q: › Change the grammar to recognise operators written in textual format 'add', 'sub', 'mul', 'div'.


A:

"                                                   \
number   : /-?[0-9]+/ ;                             \
operator : 'add' | 'sub' | 'mul' | 'div';           \
expr     : <number> | '(' <operator> <expr>+ ')' ;  \
lispy    : /^/ <operator> <expr>+ /$/ ;             \
"

{"content":{"id":1050,"title":"Weekly Links - The Glorious Future Of Technology Edition","body":"\u003cul\u003e\r\n\u003cli\u003e\r\nNeed a book to read? Try \u003ca href=\"https://www.amazon.ca/Savaged-Systemd-Erotic-Unix-Encounter-ebook/dp/B075DYXZW1\"\u003eSavaged by Systemd: an Erotic Unix Encounter\u003c/a\u003e. Amazon also recommended 'git commit murder'.\r\n\u003c/li\u003e\r\n\u003cli\u003e\r\n\u003ca href=\"http://ishikawa-vision.org/vision/DPM/\"\u003eDynamic projection mapping\u003c/a\u003e is cooler than I could possibly describe in words.\r\n\u003c/li\u003e\r\n\u003cli\u003e\r\n\u003ca href=\"https://www.clickhole.com/yoda-is-supposed-to-be-just-a-normal-guy-1829478120\"\u003eYoda is supposed to be just a normal guy\u003c/a\u003e (by George Lucas).\r\n\u003c/li\u003e\r\n\u003cli\u003e\r\nBritish TV in the 60s is completely inexplicable. \u003ca href=\"https://youtu.be/HdkixaxjZCM\"\u003eHere\u003c/a\u003e is couple elderly, enthusiastic men playing a wacky version of Bye Bye Blues on a mellotron.\r\n\u003c/li\u003e\r\n\u003cli\u003e\r\n\u003ca href=\"https://youtu.be/XXN9HjLJvdc\"\u003eThe first step to building an irl holodeck\u003c/a\u003e. It looks really pretty.\r\n\u003c/li\u003e\r\n\u003cli\u003e\r\nA JS library to generate \u003ca href=\"https://github.com/jwilber/roughViz\"\u003egraphs that look like they were cutely sketched by hand\u003c/a\u003e.\r\n\u003c/li\u003e\r\n\u003c/ul\u003e","publication_date":"2019-12-02T00:00:00.000Z","created_at":"2019-12-01T18:24:35.000Z","updated_at":"2019-12-01T18:36:58.000Z","user_id":1,"rating":null},"tags":"\u003ca class=\"changeable-title\" href=\"/q?tag=weekly_links\"\u003eweekly_links\u003c/a\u003e \u003ca class=\"changeable-title\" href=\"/q?tag=unix\"\u003eunix\u003c/a\u003e \u003ca class=\"changeable-title\" href=\"/q?tag=linux\"\u003elinux\u003c/a\u003e \u003ca class=\"changeable-title\" href=\"/q?tag=programming\"\u003eprogramming\u003c/a\u003e \u003ca class=\"changeable-title\" href=\"/q?tag=japan\"\u003ejapan\u003c/a\u003e \u003ca class=\"changeable-title\" href=\"/q?tag=music\"\u003emusic\u003c/a\u003e \u003ca class=\"changeable-title\" href=\"/q?tag=synthesizers\"\u003esynthesizers\u003c/a\u003e \u003ca class=\"changeable-title\" href=\"/q?tag=the_sixties\"\u003ethe_sixties\u003c/a\u003e \u003ca class=\"changeable-title\" href=\"/q?tag=twentieth_century\"\u003etwentieth_century\u003c/a\u003e \u003ca class=\"changeable-title\" href=\"/q?tag=javascript\"\u003ejavascript\u003c/a\u003e \u003ca class=\"changeable-title\" href=\"/q?tag=bored_of_star_wars\"\u003ebored_of_star_wars\u003c/a\u003e"}

Weekly Links - The Glorious Future Of Technology Edition

{"content":{"id":1015,"title":"'Build Your Own Lisp' Solutions: 6.4","body":"\u003cp\u003e\u003cb\u003eQ:\u003c/b\u003e Change the grammar to add a new operator such as '%'.\u003c/p\u003e\r\n\u003cbr\u003e\r\n\u003cp\u003e\u003cb\u003eA:\u003c/b\u003e \r\n\u003cpre\u003e\u003ccode class=\"cpp\"\u003e\" \\\r\nnumber : /-?[0-9]+/ ; \\\r\noperator : '+' | '-' | '*' | '/' | '%'; \\\r\nexpr : \u0026lt;number\u003e | '(' \u0026lt;operator\u003e \u0026lt;expr\u003e+ ')' ; \\\r\nlispy : /^/ \u0026lt;operator\u003e \u0026lt;expr\u003e+ /$/ ; \\\r\n\"\r\n\u003c/code\u003e\u003c/pre\u003e\r\n\u003c/p\u003e","publication_date":"2019-11-27T00:00:00.000Z","created_at":"2019-10-28T19:56:26.000Z","updated_at":"2019-10-28T20:03:09.000Z","user_id":1,"rating":null},"tags":"\u003ca class=\"changeable-title\" href=\"/q?tag=c\"\u003ec\u003c/a\u003e \u003ca class=\"changeable-title\" href=\"/q?tag=lisp\"\u003elisp\u003c/a\u003e \u003ca class=\"changeable-title\" href=\"/q?tag=build_your_own_lisp\"\u003ebuild_your_own_lisp\u003c/a\u003e \u003ca class=\"changeable-title\" href=\"/q?tag=answers\"\u003eanswers\u003c/a\u003e \u003ca class=\"changeable-title\" href=\"/q?tag=programming\"\u003eprogramming\u003c/a\u003e"}

'Build Your Own Lisp' Solutions: 6.4

Q: Change the grammar to add a new operator such as '%'.


A:

"                                                   \
number   : /-?[0-9]+/ ;                             \
operator : '+' | '-' | '*' | '/' | '%';             \
expr     : <number> | '(' <operator> <expr>+ ')' ;  \
lispy    : /^/ <operator> <expr>+ /$/ ;             \
"

{"content":{"id":1039,"title":"Weekly Links - Video Edition","body":"\u003cp\u003e\r\nI try not to post too many videos in weekly links, which means I now have a huge backlog of videos. Enjoy.\r\n\u003c/p\u003e\r\n\u003cbr\u003e\r\n\u003cul\u003e\r\n\u003cli\u003e\r\n\u003ca href=\"https://youtu.be/5DaVnriHhPc\"\u003eDeeply artificial trees\u003c/a\u003e. Super disturbing and you must click on it.\r\n\u003c/li\u003e\r\n\u003cli\u003e\r\n\u003ca href=\"https://www.youtube.com/watch?v=vL7X6fdgzhU\"\u003eClassic Taiwanese children's show in Minnan\u003c/a\u003e. The most impressive and dramatic puppet violence you will ever see.\r\n\u003c/li\u003e\r\n\u003cli\u003e\r\nAncient Clickhole Of The Week: \u003ca href=\"https://www.clickhole.com/share-this-on-portugal-s-facebook-page-to-let-them-know-1831644186\"\u003eShare This On Portugal’s Facebook Page To Let Them Know They Had A Good Run But It’s Time To Call It Quits\u003c/a\u003e.\r\n\u003c/li\u003e\r\n\u003cli\u003e\r\nThe Mellotron was an early 60s synthesizer with an eerie sound that was used in Strawberry Fields, among others. Watch \u003ca href=\"https://youtu.be/ByD8gH7kYxs\"\u003ethis super interesting video\u003c/a\u003e where an awesome mechanical genius shows the inner workings of a Mellotron she repaired.\r\n\u003c/li\u003e\r\n\u003cli\u003e\r\n\u003ca href=\"https://youtu.be/a1UaLtwR3Uc\"\u003eWerner Herzog narrates a cute cat video\u003c/a\u003e.\r\n\u003c/li\u003e\r\n\u003cli\u003e\r\n\u003ca href=\"https://youtu.be/iMJBGCC6akc\"\u003eThe world's largest Ocarina\u003c/a\u003e.\r\n\u003c/li\u003e\r\n\u003c/ul\u003e","publication_date":"2019-11-24T00:00:00.000Z","created_at":"2019-11-23T17:39:20.000Z","updated_at":"2019-11-24T20:18:25.000Z","user_id":1,"rating":null},"tags":"\u003ca class=\"changeable-title\" href=\"/q?tag=weekly_links\"\u003eweekly_links\u003c/a\u003e \u003ca class=\"changeable-title\" href=\"/q?tag=painting\"\u003epainting\u003c/a\u003e \u003ca class=\"changeable-title\" href=\"/q?tag=scary\"\u003escary\u003c/a\u003e \u003ca class=\"changeable-title\" href=\"/q?tag=programming\"\u003eprogramming\u003c/a\u003e \u003ca class=\"changeable-title\" href=\"/q?tag=chinese\"\u003echinese\u003c/a\u003e \u003ca class=\"changeable-title\" href=\"/q?tag=taiwan\"\u003etaiwan\u003c/a\u003e \u003ca class=\"changeable-title\" href=\"/q?tag=ancient_clickhole\"\u003eancient_clickhole\u003c/a\u003e \u003ca class=\"changeable-title\" href=\"/q?tag=portugal\"\u003eportugal\u003c/a\u003e \u003ca class=\"changeable-title\" href=\"/q?tag=music\"\u003emusic\u003c/a\u003e \u003ca class=\"changeable-title\" href=\"/q?tag=animals\"\u003eanimals\u003c/a\u003e \u003ca class=\"changeable-title\" href=\"/q?tag=cats\"\u003ecats\u003c/a\u003e \u003ca class=\"changeable-title\" href=\"/q?tag=werner_herzog\"\u003ewerner_herzog\u003c/a\u003e \u003ca class=\"changeable-title\" href=\"/q?tag=ocarinas\"\u003eocarinas\u003c/a\u003e"}

Weekly Links - Video Edition

I try not to post too many videos in weekly links, which means I now have a huge backlog of videos. Enjoy.


{"content":{"id":1034,"title":"Weekly Links - Feeling Happy Because Life Is Good Edition","body":"\u003cul\u003e\r\n\u003cli\u003e\r\nSomeone must have hacked the BBC news website, because they did two entire stories that weren't about tweets: \u003ca href=\"https://www.bbc.com/news/entertainment-arts-50403561\"\u003eRod Stewart's cool-as-hell model train set\u003c/a\u003e and \u003ca href=\"https://www.bbc.com/news/newsbeat-49690173\"\u003eThe Comedy Wildlife Awards\u003c/a\u003e.\r\n\u003c/li\u003e\r\n\u003cli\u003e\r\nGNOME is refusing to settle with a patent troll, on principle. If you can, \u003ca href=\"https://www.gnome.org/news/2019/10/gnome-files-defense-against-patent-troll/\"\u003egive them money\u003c/a\u003e before cokeheads use loopholes in legal systems to end the golden age of technological progress we are currently living it.\r\n\u003c/li\u003e\r\n\u003cli\u003e\r\nI think Inuktitut is the most beautiful language I've ever heard. I used to watch the nightly news in Inuktitut, not because I understood a single word, but because the host's especially-beautiful voice was hypnotic. \u003ca href=\"https://www.cbc.ca/player/play/2445421474\"\u003eHere's a career highlight reel from when she retired\u003c/a\u003e.\r\n\u003c/li\u003e\r\n\u003cli\u003e\r\nThe 6502 is a legendary processor that was used in the NES, Commodore 64, Apple II, and countless others (not to mention close-derivatives). It's also still the best way to learn Assembly, because it is relatively straightforward. \u003ca href=\"https://floooh.github.io/visual6502remix/\"\u003eVisual 6502 Circuit Webapp\u003c/a\u003e.\r\n\u003c/li\u003e\r\n\u003cli\u003e\r\nAncient Clickhole of the Week: \u003ca href=\"https://www.clickhole.com/6-of-the-biggest-differences-between-the-british-versio-1831019010\"\u003e6 Of The Biggest Differences Between The British Version Of ‘The Office’ And The Zapruder Film\u003c/a\u003e.\r\n\u003c/li\u003e\r\n\u003cli\u003e\r\n\u003ca href=\"https://soranews24.com/2019/09/01/tokyos-amazing-2d-cafe-looks-like-an-illustration-but-its-an-actual-restaurant-you-can-eat-in/\"\u003eReal places that look like drawings\u003c/a\u003e are an Internet staple, and I love them.\r\n\u003c/li\u003e\r\n\u003c/ul\u003e","publication_date":"2019-11-17T00:00:00.000Z","created_at":"2019-11-16T18:14:57.000Z","updated_at":"2019-11-16T18:43:59.000Z","user_id":1,"rating":null},"tags":"\u003ca class=\"changeable-title\" href=\"/q?tag=weekly_links\"\u003eweekly_links\u003c/a\u003e \u003ca class=\"changeable-title\" href=\"/q?tag=music\"\u003emusic\u003c/a\u003e \u003ca class=\"changeable-title\" href=\"/q?tag=animals\"\u003eanimals\u003c/a\u003e \u003ca class=\"changeable-title\" href=\"/q?tag=birds\"\u003ebirds\u003c/a\u003e \u003ca class=\"changeable-title\" href=\"/q?tag=nature\"\u003enature\u003c/a\u003e \u003ca class=\"changeable-title\" href=\"/q?tag=news\"\u003enews\u003c/a\u003e \u003ca class=\"changeable-title\" href=\"/q?tag=language\"\u003elanguage\u003c/a\u003e \u003ca class=\"changeable-title\" href=\"/q?tag=canada\"\u003ecanada\u003c/a\u003e \u003ca class=\"changeable-title\" href=\"/q?tag=inuktitut\"\u003einuktitut\u003c/a\u003e \u003ca class=\"changeable-title\" href=\"/q?tag=programming\"\u003eprogramming\u003c/a\u003e \u003ca class=\"changeable-title\" href=\"/q?tag=assembly\"\u003eassembly\u003c/a\u003e \u003ca class=\"changeable-title\" href=\"/q?tag=ancient_clickhole\"\u003eancient_clickhole\u003c/a\u003e"}

Weekly Links - Feeling Happy Because Life Is Good Edition

{"content":{"id":982,"title":"'Build Your Own Lisp' Solutions: 6.3","body":"\u003cp\u003e\u003cb\u003eQ:\u003c/b\u003e Write a regular expression matching pit, pot and respite but not peat, spit, or part.\u003c/p\u003e\r\n\u003cbr\u003e\r\n\u003cp\u003e\u003cb\u003eA:\u003c/b\u003e \r\n\u003cpre\u003e\u003ccode class=\"cpp\"\u003e# This works, but is a weird answer to a weird exercise.\r\n/(^|res)p[io]/\r\n\u003c/code\u003e\u003c/pre\u003e\r\n\u003c/p\u003e","publication_date":"2019-11-13T00:00:00.000Z","created_at":"2019-10-16T01:07:00.000Z","updated_at":"2019-10-16T01:12:33.000Z","user_id":1,"rating":null},"tags":"\u003ca class=\"changeable-title\" href=\"/q?tag=c\"\u003ec\u003c/a\u003e \u003ca class=\"changeable-title\" href=\"/q?tag=lisp\"\u003elisp\u003c/a\u003e \u003ca class=\"changeable-title\" href=\"/q?tag=build_your_own_lisp\"\u003ebuild_your_own_lisp\u003c/a\u003e \u003ca class=\"changeable-title\" href=\"/q?tag=answers\"\u003eanswers\u003c/a\u003e \u003ca class=\"changeable-title\" href=\"/q?tag=programming\"\u003eprogramming\u003c/a\u003e"}

'Build Your Own Lisp' Solutions: 6.3

Q: Write a regular expression matching pit, pot and respite but not peat, spit, or part.


A:

# This works, but is a weird answer to a weird exercise.
/(^|res)p[io]/