Freewheeling Apps Devlog
Jun 4, 2022
Seamlessly mixing plain text and line drawings

http://akkartik.name/lines.html

Screenshot of some text and some line-drawings

permalink

* *
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: https://gist.github.com/akkartik/20a0c7e7589c6179666fc78bc04b28b4

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 here 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

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