Weeknotes 2024 W25: Nanoc 4.13
Quick bits:
-
I gave myself a haircut. It was about time.
-
I slept with the window open the other day — hooray for summer temperatures — and woke up at 5 AM to the noise of so many animals, including plenty ones that I did not recognize. Dogs, foxes, crows, pigeons, and plenty more. I live pretty centrally in Berlin yet it occasionally feels like the forest here.
-
The job search is moving along slowly. I’ve got multiple things in progress, though nothing to report just yet.
-
My Fitbit is still lost. I wrote about losing my Fitbit a few weeks ago, and I had hoped that it would magically turn up in the mean time as I was going about my daily business, but alas. When it still had battery, I could walk around the apartment with a Bluetooth locator app on my iPhone, like a dowsing rod, and it’d give a rough approximation of where it could be. But it’s still missing, and I have turned the place upside down to no avail. So strange.
-
For no particular reason, I have switched to the other side of my giant mattress, thereby continuing use of my patent-pending Denis Mattress Wear Leveling (DMWL) technique.
-
Here is an idea for which AI can be useful: recut one movie to match the sound of a different movie. Imagine recutting Oppenheimer so that the sound match that of Barbie Girl by Aqua. I don’t have the skill to make that a reality, so someone else make that happen, please.
I finally had my first Gemüsekebab from the food truck near me. I wrote about this place back in March, but did not get around to going there because of the frighteningly long queue.
The queue wasn’t long1 this time around. This was, in part, because I accidentally jumped the queue.2 When I apologized to the people who I jumped in front of, they urged me to stay where I was in the queue. How confusing.
The food was decent and pretty cheap (€6.5) but I don’t think it’s quite worth the queueing time. Would I go there again? Probably not — the queue makes it not worth it.
I don’t understand the hype. The area feels like it has a party atmosphere; so many people are hanging around, having a drink and eating their kebab. But what makes this place so special?3
I released Nanoc version 4.13. This release adds a --focus option, which is useful when you want to recompile only a part of your web site while you’re iterating. It can really help tighten the feedback loop, and that’s always good.4
With the arrival of Nanoc 4.13, the version number looks a little less strange. The version before that was 4.12.21, which looks more like a date — too many digits — than a version number.5
I’ve been having a lot of fun with game development with LÖVE. I’ve created a Solitaire6 implementation, because a) Solitaire is fun and challenging to play, and b) fairly straightforward to implement.
My time is spent in learning the game development framework, and figuring out how to structure the game code, and make the UI/UX juicy. Polish is where it’s at.
I also ended up with a component-based design and a scene tree, which makes some challenges, like alignment and fancy animation, remarkably straightforward.
I don’t have anything to show just yet, and I’ll likely bring it to a more finished state first before sharing anything. Perhaps next weeknotes?
I have discovered Itch.io’s list of game jams, and it’s huge.
I only ever participated in a single game jam, and that was ten years ago. At the Berlin Mini Game Jam, I and two others built a game called Black and White. That was fun, but exhausting: we spent eight hours in focus on a Saturday, and it felt like I didn’t have a proper full weekend anymore, and it felt like a Saturday of, well, work.
Still, the game jam was fun and rewarding, and I have clear and fond memories, even a decade later. I’d be up for doing something like that again. Perhaps I will join one of those game jams after all.
There is the common misconception that the best-case time complexity for sorting algorithms is , with being the number of items to sort. But this is only true for comparison sort, and it is possible to get better results in some cases.
One of those cases is drawing element on a screen. Here is some code I wrote earlier:
function Scene:draw()
-- Group children by z
local buckets = {}
for idx, child in pairs(self.children) do
local bucket = buckets[child.z]
if not bucket then
bucket = {}
buckets[child.z] = bucket
end
bucket[idx] = child
end
-- Sort groups
local zs = {}
for z in pairs(buckets) do
table.insert(zs, z)
end
table.sort(zs)
-- Draw children
for _, z in pairs(zs) do
local bucket = buckets[z]
for _, child in pairs(bucket) do
child:draw()
end
end
end
This places all items in buckets of a specific z index, and then sorts those buckets. This is why, to nobody’s surprise, this algorithm is called bucket sort.7
Of special note is table.sort(zs)
, which sorts the collection zs
of unique z
values. If the number of unique z
values is low, then this can be significantly faster.
And yes, I might be optimizing prematurely.
Entertainment:
- Despite having had it lying around in my library forever, I finally got around to playing A Short Hike.8 It’s cute and cozy! What a wonderful experience.
Tweets and toots:
- https://eigenmagic.net/@abstractcode/112651728942492358 Love this: “‘TODO’ in code doesn’t mean you’re actually going to do it, it means you don’t want questions about why you didn’t do it.”
Links:
-
True Facts: Plants That Explode (Zefrank): Boom!
-
JSKIDPIX v1.0.2021: Kid Pix was a thing I used as a kid!
-
The answer isn’t Online Masculinity (struthless)
-
Trump’s Second Term (Last Week Tonight with John Oliver)
-
The Biggest Lie in Hollywood: Technicolor (NationSquid): I admit that I have never given it any thought how color got onto film in a pre-digital world.
Entertainment links:
-
What if you drained the oceans? (xkcd’s What If?): I’ve always been afraid of the Dutch and now I can’t sleep anymore
-
How YOU Wrote Rimworld’s Best Story (Adam Millard)
Tech links:
-
Rumors on the Internet say that the queue can be up to two hours. ↩︎
-
In my defense, Germans don’t know how to queue; I misinterpreted who was queueing and who was just randomly standing around. ↩︎
-
My money would be on “YouTube personality opens Kebab place,” but I can’t imagine that is the full explanation. ↩︎
-
Come to think of it, tight feedback loops are generally amazing, and perhaps it is worth writing about this concept in more detail. 90% of the stuff I do at work is tighten feedback loops. ↩︎
-
Special shoutout to Nanoc 4.11.20, whose version number looks like a date, November 4th, 2020, but was released on December 18th, 2020. This is the release whose version, when interpreted as a date, is the closest to its actual release date. The chance is very slim that any future Nanoc release will have a version whose date interpretation is closer to its own release date than Nanoc 4.11.20, so I suppose it’s only downhill from here. ↩︎
-
Also known as Patience and Klondike. ↩︎
-
My implementation isn’t strictly bucket sort, as I don’t sort the contents of the buckets — the order of children is not relevant. ↩︎
-
A Short Hike (Adam Robinson-Yu, 2019). ↩︎