May 31, 2022
Gravity simulation for the kids

https://gist.github.com/akkartik/001dcd31aa0e042df0b0a0408f99d742

It's amazing how short the core of Newton's law of gravity is:

theta = angle(sun.x,sun.y, sat.x, sat.y)
dist = distance(sun.x,sun.y, sat.x,sat.y)
accelx = K*cos(theta)/dist/dist
accely = K*sin(theta)/dist/dist
velx = velx + dt*accelx
vely = vely + dt*accely
posx = posx + velx
posy = posy + vely
plot(posx,posy)

permalink

* *
May 4, 2022
I finally, *really* grok immediate-mode GUIs. Compare `draw_menu`.

Before

After

Now I don't need variables to record where the buttons are, and code for button events lives near code for drawing the button.

permalink

* *
May 3, 2022
Shower thought: we delay teaching kids geometry until we can trust them not to poke someone's eye out with the pointy end of a compass.

Here's a little program to do compass-and-straightedge geometrical construction on a computer.

Constructing a second line (in black) parallel to a given line (red) passing through a given point.

permalink

* *
Apr 23, 2022
First programming lesson for 4yo: how to make a U-turn when all you have is a left-turn. How to make a right-turn when all you have is a left-turn.

permalink

* *
Apr 15, 2022
Does anyone have experience implementing a Mastodon client? I've been reading links like https://www.w3.org/TR/activitypub and https://blog.joinmastodon.org/2018/06/how-to-implement-a-basic-activitypub-server, but I already have a server I'm perfectly happy with. How do I authenticate with it? Just by its custom authentication methods?

I guess I'm wondering if every Mastodon server also has some non-ActivityPub API.

permalink

* *
Apr 14, 2022
Building resilient systems

Systems are made of parts.

If you have too many parts, the odds of one of them failing go up.

If you have too few parts, any single part failing has a larger impact.

THEREFORE,

Arrange the parts in multiple phases over time. Like bulkheads, failures get isolated to a single phase.

Within a phase, use few parts to improve your odds.

Example: use git to generate your site, but host it on Netlify. Now you can build without Netlify and serve traffic without Github.

permalink

* *
Apr 6, 2022
I just did a fun bit of retrocomputing archeology.

I wanted to give the kids a Paint program, so I did a quick Google in my current favorite framework and found https://love2d.org/forums/viewtopic.php?t=87469. Ran great and was loads of fun, but looked a bit.. off. Some of the colors were missing, and clicking on the black rectangles sometimes abruptly changed the color. Turns out:

“In versions prior to 11.0, color component values were within the range of 0 to 255 instead of 0 to 1.”

https://love2d.org/wiki/love.graphics.setColor

Before: Paint app when I first ran it.

After: Paint app after I fixed it.

permalink

* *
Apr 3, 2022
We have an old computer the kids use to watch Cocomelon. It runs Windows. We've also been playing with some Love2D programs on my Linux computer. Today I installed Love2D on the Windows computer. Now they can run programs on their computer. Programs I can tweak over time, that they may peek at.

I'd always felt bad that my Linux-only programs excluded Windows users. But I didn't realize they were excluding me as well. In this way I come back face to face with the oneness of all things.

permalink

* *
Apr 1, 2022
On the positive side, the kids enjoyed playing with those Game of Life apps today. The question they asked me later:

Is this Mu or Teliva?

So now they know that there are other programmers on the planet.

permalink

* *
Mar 31, 2022
It's not just a matter of deleting features. Any time I innovate a feature even slightly, I find myself doing something I don't have the skills for. I lost the first version of this comment thread, writing it on my Teliva-based editor (which provides character counts for chunks). Fucking stupid bug, and it was all me.

Software benefits from testing. If you use software with few users, it's almost certain to be under-tested.

I also can't just ignore all the considerations of industrial software.

I can't just do it from scratch because I don't have all the skills. Deciding what to depend on is also thorny. Pulling in irrelevancies vs excluding people.

5% of software lasts a long time. (Analogy with food breaks down there.) Hard to tell which 5% it is. (Analogy with building roads/bridges breaks down there.)

If I were to ever have any success, I'll be dealing with awkward requests, the risk of burnout.

One thing is clear: the dream/temptation to "scale up" is poison. But it's unclear what's left. We end up with a few people scattered in a humongous state space mostly building stuff for ourselves, nibbling at the margins of the software industrial complex, while unable to actually extricate ourselves from it.

You can have both kinds of software, the kind that's unreliable because the authors are indifferent/malicious or the kind that's unreliable because the authors don't have enough support.

permalink

* *
archive
projects
writings
videos
subscribe
Mastodon
RSS (?)
twtxt (?)
Station (?)