In my online undergraduate P5.js course, students are about to begin the module on motion and physics, including a bit of physics simulation using Matter.js. It suddenly occurred to me that I had never seen anybody put together this particular demo before, and I realized it had to be done. Messy source code at https://editor.p5js.org/isohedral/full/vJa5RiZWs.
@csk so... https://nesbitt.io/xkcd-2347/ it's slightly different in that it's not the original - though it is matter.js. It took me hitting the button twice to realise what was going on - it recreates the cartoon for random real projects. I like it all tho; I did xkcd 208 for advent of code a couple of years back https://hachyderm.io/@bazzargh/113622743090408785 (...with entirely unrealistic physics)
@csk also, recently I said I'd been nerdsniped and one of my younger colleagues asked what I meant; I dropped a link to https://xkcd.com/356/ and then realised it's *19 years old* (so is the "I know regular expressions" one)...so came out before he could read...how did we get so old? A warning for showing this to students ;)
Nerd Sniping

xkcd
@bazzargh @csk https://xkcd.com/435/ My favorite, which I regularly show my physics students.
Purity

xkcd
@csk missed opportunity.
xkcd 2347: Dependency

Someday ImageMagick will finally break for good and we'll have a long period of scrambling as we try to reassemble civilization from the rubble.

@csk *Beautiful* work!
@csk I gave it a try last year!
https://social.coletivos.org/@Introscopia/113799812434831228
powered by chipmunk physics!
Introscopia (@[email protected])

Attached: 1 image Inspired by a bluesky user who posted this classic XKCD without the nebraskan block and the simple caption "2025"..... let's hope not!

coletivos.org
@csk This is what the Internet was made for
@csk
But why shove it out left?
@csk this is excellent!

@csk
@ahl made something similar a while back, but this fully interactive demo is great!

https://mastodon.social/@ahl/112242906033081880

@csk i like how there seems to be no friction and despite what block you klick, after some duration everything crumbles, even if you do not move the cursor while klicking.
@glowl @csk okay that is very funny actually.
@glowl @csk everything just slowly sliding
@csk @creideiki what it looks like after the "move fast and break things" folks have their way with it.
@csk I hope you've sent this to Randall Munroe! Also, @bagder , this is for you.
@csk I've just spent entirely too much of my day destroying this tower and refreshing the page. Thank you, you win the internet for today!
@csk tbh I didn't realise that this was a simulation until I spied the 'gif' button there and ... holy smokes ... awesome ... :)
@csk Register the mousemove handler on the window object, then you will get the events even when the mouse moves out of the window/frame while dragging.
@bloody_albatross If we're talking about improving the code, then I'd be more interested in the question of how to get a stable tower to stand up in a physics sim without bouncing all over the place and collapsing spontaneously. In this demo I use a cheap hack of freezing all the blocks until you actually click on one of them. Presumably it's really hard to get this working correctly (cc @topher_batty)
@csk @topher_batty I feel like that is basically what all games do anyway. Also saves CPU.
@bloody_albatross @csk Paul Kry even had a paper where they sort of generalize the freezing idea to merging together collections of rigid bodies whose relative motion is small enough. https://eulaliecoevoet.github.io/AdaptiveMerging/
Adaptive Merging for Rigid Body Simulation

With adaptive merging we reduce computation time in rigid body simulations.

AdaptiveMerging
@bloody_albatross @csk I'm not sure of the latest and greatest in academic rigid body stacking, but I've used Danny Kaufman's 2008 staggered projections scheme successfully for one paper: https://www.cs.ubc.ca/labs/sensorimotor/projects/sp_sigasia08/KSJP08.pdf Downside is you usually need to start bringing in better LCP or QP solvers.
@csk
did it with blender and later even made a soundtrack
https://www.youtube.com/watch?v=T3s2JosdrNM
animated xkcd 2347 /// all modern digital infrastructure poked by Jia Tan on XZ Utils

YouTube
@csk This needs to be made into an Angry Birds level.
@Humus @csk hmm, maybe turn it into an awareness-building game (a la tower defense games) where you must fend-off hackers trying to topple the whole tower over and whack knowledge into capitalists'/politicians' heads that treat the ecosystem as a black-box; boss level: secure funding without caving into three-letter agencies pressuring the dev to sneak vulnerabilities.
@csk Sometimes I wonder if this isn't the right solution to the software problem.
@csk Ha! I saw this on HN earlier, and didn’t realise it was you. Very nice.
@robinhouston Yeah, it's really making the rounds! I must tip my hat to the people who came over to show their earlier demos of the same idea -- it really was hard to believe that nobody had thought to do this before.
@csk Excellent work here.
@csk So you're saying if you shove aside the random person in Nebraska the architecture simplifies itself to something with fewer layers? 😆
@ChuckMcManis @csk that took some real cajones chuck haha!
@csk Hah, just noticed that, if you click on the p5js link, it’s interactive! Awesome
@csk This is fantastic!
@csk This is incredibly satisfying to table-flip. My day needed this. Thank you.
@csk excellent vibe coding simulator!
@csk Turned out great! Thanks for sharing 😆👍

@csk Wonderful!

I made your code even messier by introducing a small... let's say "typographic" improvement:

https://editor.p5js.org/lenaschimmel/full/l74GivEMb

p5.js Web Editor

A web editor for p5.js, a JavaScript library with the goal of making coding accessible to artists, designers, educators, and beginners.

@lenaschimmel @csk

This one has a lot of optional ways to destabilize the system. Pick up a tiny block from the top, don't drop it, and watch the instability move through the carefully balanced system-- over and over.

@csk Great!

When will we get a version with this?

https://social.linux.pizza/@latenightowl/115583403324505126

Late Night Owl (@[email protected])

Attached: 1 image I haven't seen this variation of XKCD 2347 yet. Received from a friend, source unknown. #xkcd2347 #cloudflare #aws #ai

Linux.Pizza

@csk This interactive version is amazing!

I just wanted to note that @ahl at least animated this for an episode of Oxide and Friends about the XZ backdoor.

https://mastodon.social/@ahl/112243108119871893

@csk I love the idea, but it's unstable in its base config already. Just clicking into the image changes the setup.
@csk Classic! 🤓 Attribution of input web comic: https://xkcd.com/2347/
#xkcd
Dependency

xkcd