A place for musings, observations, design notes, code snippets - my thought gists.
Haptics at 300kph
Apple released a new “Haptic Trailer” for their new F1 movie - you can check it out in the Apple TV app. It’s a pretty neat experience, I’d never thought about adding haptics to a playback experience, but it really does add another dimension of immersion.
I was curious on how it was implemented, and stumbled across a great blog post that really shook it out for me… I’m sure it’d get horrifically overused, but it’d be interesting to see whether this gets adopted into more media streams in the future.
Building animations in Manim with LLMs
Manim is a Python animation engine designed to build animated mathematical explainer videos (examples here) created by Grant Sanderson of the superb YouTube channel 3Blue1Brown.
A couple years ago I wanted to write my own mathematics explainer videos with Manim, but found the learning curve to be pretty steep at the outset.
The user experience has since improved dramatically - in large part because of the Manim Community Edition, but also because there’s now enough samples in recent LLM training runs that they can produce workable Manim code!
I stumbled across a neat website (GitHub) that allows you to prompt either a SOTA LLM or a fine-tuned GPT-3.5 model and have Manim code generated and rendered in-browser. The quality is passable at best (and I’ve observed better results prompting whatever default model ChatGPT is serving up as of writing), but the barrier to entry just dropped remarkably. I can jump right in with a MVP and start tweaking!
Also shoutout to a cool project I stumbled along on the way: ManimWeb, a Dart-backed engine to build interactive maths animations for the web. Development seems to have died a few years ago, but the Fourier Transform example is neat to play around with.
An aside on retro gaming on Mac
I’m not much of a gamer. In fact, I don’t think I’ve played any games in the past decade.
But I do have very fond memories of playing a couple games on an old translucent iMac G3 in the school computer room in primary.
On some late night Wikipedia rabbit hole I ended up on the page for Antz and was reminded of the old-school-cool games I’d played: Bugdom and Nanosaur.
It turns out, they’re been immortalised and ported to run on macOS with Apple Silicon. You can download them (for free): Nanosaur and Bugdom2. They run like a charm and with beautiful graphics scaling to boot!
Meditations by Marcus Aurelius
I picked up a beautiful copy of Meditations by Marcus Aurelius in a cute bookstore in Korea (Chiltern Publishing, translated by A.S.L Farquharson).
I purchased it mostly on a whim - it’d been a while since I’d read any true classics, and the bind was truly delightful (it’s this beautifully embossed, textured cover with a gilt silver coating across the paper edges).
The book overall? It’s filled with Stoic aphorisms and pithy existential ruminations. How ‘meditative’ that is to modern sensibilities is up to the individual. Though you do get the occasional good nugget of advice like:
The mountain mouse and the town mouse, and the fright and scurry of the latter.1
Though it must be said that it truly is surreal to read a piece of text immortalised in the canon of literature. In that vein, it was fascinating to see lacunae (“[corrupted text missing]”) mid-sentence. I always wonder what happened to that particular excerpt and how and why it became lost to the sands of time.
Well, I guess one epithet is indeed true enough - don’t judge a book by its cover.
There are some selected quotes that touch on themes of honesty, existentialism and metaphysics that I liked the gist of:
- Continually and, if possible, on the occasion of every imagination, test it by natural science, by psychology, by logic.
- Speak both in the senate and to every man of whatever rank with propriety, without affectation. Use words that ring true.
- The Universal Nature felt an impulse to create a world; and now either everything that comes into being arises by way of necessary consequence, or even the sovereign ends to which the ruling principle of the world directs its own impulse are devoid of reason. To remind yourself of this will make you clamer in the face of many accidents.
- The sun appears to be poured down and indeed is poured in every direction but not poured out. For this pouring is extension, and so its beams are called rays from their being extended. Now you may see what kind of thing a ray is by observing the sun’s light streaming through a chink into a darkened room. For it is stretched in a straight line, and rests so to speak upon any solid body that meets it and cuts off the flow of air beyond. It rests there and does not glide off or fall. The pouring and diffusion of the understanding then should be similar, in no way a pouring out, but an extension, and it should not rest forcibly or violently on obstacles that meet it nor yet fall down, but stand still and illuminate the object that receives it; for that which does not reflect it will rob itself of the light.
-
Which I have since learned is an allusion to one of Aesop’s Fables ↩︎
Mapbox documentation uses real tokens
I’ve been working on a small side project that requires embedding an interactive map. I spent some time evaluating different mapping providers - initially OpenStreetMap with leaflet for annotations. OpenStreetMap is great for rapid prototyping since it’s free and doesn’t require any API key, but it doesn’t look great (by default, at least) and it doesn’t have the same rich POI data integration.
I dabbled with Mapbox next and was really impressed. It has end-to-end API coverage for heaps of mapping use cases, and provides lots of examples of how to integrate Mapbox into your choice of language/platform/framework. However, the thing that really stood out to was their onboarding design. Once you create an account and login, Mapbox injects your API keys directly into the example code on the webpage. They literally inject your personal API key into the standard examples for logged in users so that you can copy/paste and immediately start working.
I ended up settling on Apple’s Mapkit JS. It’s got a generous free tier allowance (as per Apple usual, only if you pay for an Apple Developer account, which is fair) and a nice UI. The downsides are that it doesn’t have any React bindings, so you have to roll your own wrapper, and the overall documentation is lacking. The dearth of documentation is especially noticeable when contrasted to the tomes provided by Mapbox.
Internationali(z|a)tion is hard
I came across a UI glitch today in my Uber app. At first glance it appears to be a preposterous oversight, the s
in Favourites
has been orphaned!
I live in Australia, where we closely follow British English spelling - meaning it’s “Favourites” and not “Favorites”. In the world of UI/UX, it’s common to use localisation dictionaries to map strings to locale-appropriate versions. I suspect some UI designer carefully crafted this screen for US English and mapped over to AU English, accidentally committing a tiny typographic crime.
There’s a fantastic site literally called grumpy.website that aggregates many such UI/UX whoopsies. I’d definitely recommend checking it out!