HNHacker News
TopNewBestAskShowJobs

a_e_k

2,653 karma · joined September 22, 2013

http://eastfarthing.com/blog/

andrew at $DOMAIN

submissionscomments
a_e_k··on Two nights of broken sleep can make people feel years older, finds study
My experience as a working parent has been that you just have to muddle through some days one way or the other. (But taking longer shifts like GP mentioned works way better than trying to split the difference within a single night.)
a_e_k··on Baltimore's Key Bridge struck by cargo ship, collapses
Crazy! Going by the higher 7.6 kn figure mentioned elsewhere in this thread, that'd be closer to 450 million N s.

For another comparison, Wikipedia gives an estimate of "Apollo 11 launched from Earth to orbit" at 495 million N s [1]. So this is a momentum that's order-of-magnitude comparable to space launches.

[1] https://en.wikipedia.org/wiki/Newton-second

a_e_k··on You Shouldn't Use VS Code
> I recommend using NeoVim or Emacs, spending a little time setting up your own configuration, and getting to work. Leave behind the creature comforts.

Funny. After years of use, Emacs is my creature comfort!

a_e_k··on Zshell
I find that feature also interacts very nicely when editing parallel paths. E.g.:

    prog/libs/foo┃/src/CMakeList.txt             Start with one path
    prog/libs/some┃/src/CMakeList.txt            Edit the middle part
    prog/libs/somelongname/src/CMakeList.txt┃    Press tab, completes middle and jumps to end
I was also thrilled when I noticed zsh contextually skipping some potential completions that I'd already had on my command line. E.g., if I have files `aaa` and `aab` in a directory, then hitting tab on

    git add aaa a┃
will do the right thing and immediately complete to `aab` without further prompting. (Better yet, it also does that if I'd added `aaa` with a previous command!)
a_e_k··on TrenchBroom: A cross platform level editor for Quake-engine based games
It seemed at first glance like it was pretty specific to Quake engine games, knowing how to load .wad files, etc. I was wondering how it might be adapted for a custom game. The answer is here, in case anyone else is curious:

https://trenchbroom.github.io/manual/latest/#game_configurat...

a_e_k··on Wendy's Wants to Start Uber-Like Surge Pricing in 2025
The Taco Bell near me still does that.

The difference is that they have large printed signs advertising the discounted prices and the times they apply (2p-5p). The posted prices are dependable as long as one checks a clock.

a_e_k··on Notes on paper (2023)
> retractability

As someone who always carries a pen in my pocket when I leave the house, I've come to find this one surprisingly important. Retractable pens have a habit of accidentally engaging and scribbling over the pocket fabric. I exclusively use capped pens for my daily carries now.

> left handers typically want the fastest drying ink.

Heck yes!

a_e_k··on WebKit switching to Skia for 2d graphics rendering
I'm the author of another CPU-only 2D vector graphics library that might be of interest:

- Canvas Ity (https://github.com/a-e-k/canvas_ity)

It's a tiny single-header C++ library in the style of the STB libraries. My aim was to make it dirt simple to be able to drop into almost any project and get high-quality rendering while providing an API comfortable to those used to <canvas>.

I've been checking out Blend2D every now and then. It seems like a very nice option for the bigger, but faster and more fully-featured end of the spectrum.

(Though for what it's worth, while raw performance isn't my priority, my little library still can hit about 70fps rendering the Postscript Tiger to 733x757 res with a single thread on my 7950x. :-)

a_e_k··on The likelihood of unilateral solar geoengineering
"Since the beginning of time, Man has yearned to destroy the sun. I will do the next best thing: block it out!"

https://www.youtube.com/watch?v=L3LbxDZRgA4

a_e_k··on Compiling Expressions
Yep. And whenever I've implemented a recursive-descent parser and dealt with left-associative operators, I've just inlined the equivalent of additive-expression2 and the loop. E.g.:

    def parseAddExpr():
        parseMultExpr()
        while peekToken in ["+", "-"]:
            consumeToken()
            parseMultExpr()
Honestly, I really like recursive-descent parsing, even for expressions. It's very straightforward once you've learn a few simple patterns like that.

Decently large precedence hierarchies (15-20) don't bother me; I'll typically just number the levels rather than use names like "term", "factor", "additive", or "multiplicative". It can get a little verbose, yes, but it's easy to write and skim through. (Golang-like from what I've read, though I'm not a user of Golang.)

But I also find it scales better once you start adding things like ternary expressions, function calls, and type casts -- things that aren't just simple binary operators. Handling those feels a lot less clean to me with Pratt, precedence climbing, shunting yard, etc.

One main downside that I'll admit to recursive descent though is that it's a bit harder to have a language with user-defined operators. I don't like those much, though, so that's not much of a loss to me.

a_e_k··on My favourite Git commit (2019)
I wouldn't know about the Vim equivalent, but I wrote this in my Emacs config long ago:

    (defun find-non-ascii ()
      "Find and show all of the non-ascii characters."
      (interactive)
      (occur "[[:nonascii:]]"))
It has proved quite useful on occasion.

(Yes, I could just invoke Occur directly, but I can never quite remember the regexp character class and syntax here.)

a_e_k··on Do call yourself a programmer, and other career advice (2013)
> at the end of the day this is the only job where you get paid to build completely nonphysical machines. I press keys that go clack clack, logic gates go flip flop, the electrons go zoom zoom, and my bank account goes ding ding.

https://xkcd.com/722/

a_e_k··on On non-technical video-games cheat mitigations
I rather miss this style.

Back in my younger days, I had admin privileges on a UT2k4 server. There was usually a nice group of regulars around. If I was playing and one of the regulars reported someone suspicious I could go into spectator mode, watch through their point-of-view to make sure, record it to a demo file for evidence, and then immediately ban them.

Beyond the community of regulars on our own server, we had good contacts with admins on other servers that catered to a similar gamestyle. We'd regularly exchange ban-lists with them. (I.e., there was kind of a meta community of server operators.)

I realize that that doesn't scale the same way as modern approaches, but the modern approaches also feel like they're trying to use technical means to solve a social problem.

a_e_k··on STB: Single-file public domain libraries for C/C++
I love it for doing small experiments in C++ (the kind where everything is a few hundred lines in a single file) with images too.
a_e_k··on A simulation of me: fine-tuning an LLM on 240k text messages
Something like that is the core idea behind Black Mirror S2E1, "Be Right Back" (2013).

https://en.wikipedia.org/wiki/Be_Right_Back

a_e_k··on Writing a TrueType font renderer
I have a small TTF implementation in C++ that's only a little bigger than that and is open source. It's part of my canvas_ity single-header library [0] that's around 2300 LOC / 36 KB object size and implements a C++ version of most of the 2D HTML5 canvas spec [1].

The core implementation of the TTF parsing and drawing is in L1526-L1846 with another small bit at L3205-L3274 of src/canvas_ity.hpp.

It's something of a toy implementation that only supports western left-to-right text, and doesn't do any hinting at all, nor kerning, nor shaping. But it's enough to draw a basic "Hello world!" using any typical TTF file.

The test suite in test/test.cpp L84-304 embeds a few custom Base64-encoded TTF files. They're small and only have a few glyphs but they do exercise a number of interesting edge cases in the OpenType TTF spec [2]. Have a look at the HTML5 port of the test suite at test/test.html in different browsers to see how their canvas implementations render those fonts.

[0] https://github.com/a-e-k/canvas_ity

[1] https://www.w3.org/TR/2015/REC-2dcontext-20151119/

[2] https://standards.iso.org/ittf/PubliclyAvailableStandards/c0...

a_e_k··on Unciv
Alphacross [0] is the one I keep coming back to. I don't think it's open source, but otherwise it's a nice simple no-frills crossword app. No ads, minimal permissions, sips battery, downloads puzzles on-demand and then works fine offline, etc.

[0] https://play.google.com/store/apps/details?id=org.akop.cross...

a_e_k··on The Legend of Zelda: Twilight Princess Decompilation
I saw the idea in a link and a discussion here on HN about a year ago:

G-3PO: A protocol droid for Ghidra, or GPT-3 for reverse-engineering - https://news.ycombinator.com/item?id=34250872 - Jan 2023 (44 comments)

a_e_k··on Super Mario RPG is an endearing, perplexing relic
It's generally a fun game and fairly streamlined, but there are some trash fights (mainly in the fire region) where it's really easy to get stun-locked to death. Or get a game-over from having both party members get petrified by the monsters in between your turns.

With SMRPG, you can at least still block while asleep/mushroomed/scarecrowed.

a_e_k··on Super Mario RPG is an endearing, perplexing relic
The fight with Culex re-uses the boss music from FF4, though. (Even if he never appears there.)
a_e_k··on Super Mario RPG is an endearing, perplexing relic
I think it helps that the updates to the music were done by the original composer.
a_e_k··on It's OK if your code is just good enough
For those kinds of cases, I love having as-simple-as-possible reference code checked in alongside it, even if it's just #ifdef'd out for common builds. Having a baseline makes it sooo much easier to understand and debug the optimized code.
a_e_k··on Implementing Mario's Stack Blur 15 times in C++ (with tests and benchmarks)
The convolution of a box filter with a box filter is a tent filter. So yes, a tent filter blur can be done with two box filter blurs.

And repeated box filters asymptotically approach a Gaussian filter, though in practice it converges very quickly. A single box filter can be thought of as a piece-wise constant approximation of a Gaussian filter. Two passes of box filters produce a piece-wise linear approximation (the tent). And three passes of box filters produce a piece-wise quadratic approximation. Four passes for a cubic approximation, etc. Usually, just the three box filters are used since they are close enough.

I'd need to look at the math in detail here, but I suspect that it's ultimately just cleverly interleaving the running sums for the two box filter to perform them in a single pass.

If so, it might be an interesting challenge to see if the idea can be extended to compute the higher quality three box filter approximation in a single pass.

a_e_k··on Monaspace
If you're interested in a free, but carefully hinted coding font, my Luculent font [0][1] may be worth a look. The hinting is its defining feature, since I hate fuzzy font rendering. I wrote every line of TTF hinting code in it myself (no autohinting), and it is legible down to 5x11 pixel sized characters even if you disable antialiasing, so long as your font engine interprets the hints.

[0] http://eastfarthing.com/luculent/

[1] https://fontlibrary.org/en/font/luculent (live example in browser)

a_e_k··on Steam Deck OLED
From the link:

> We fit a bigger battery into the case, and the OLED display draws less power.

a_e_k··on Sad clown paradox
Yes, Oh! a private buffoon is a light-hearted loon is also an excellent choice, too, and one that I'd debated referencing instead.

But ultimately the "Whose soul was sad, and whose glance was glum," line in I have a song to sing O! and its reprise in the finale was what led me to pick that song to quote here. (Plus that song and the music is probably my favorite among the G&S canon. :-)

a_e_k··on Sad clown paradox
My favorite example is Jack Point from Yeomen of the Guard [0]:

    Point:
        Oh, thoughtless crew!
        Ye know not what ye do!
        Attend to me, and shed a tear or two —
        For I have a song to sing, O!
    All:
        Sing me your song, O!
    Point:
        It is sung to the moon
        By a love-lorn loon,
        Who fled from the mocking throng, O!
        It's a song of a merryman, moping mum,
        Whose soul was sad, and whose glance was glum,
        Who sipped no sup, and who craved no crumb,
        As he sighed for the love of a ladye.
[0] https://youtu.be/1WDlri5ACNg?t=1801
a_e_k··on How to pronounce the trickiest English words
Anecdotal, but I feel like I tend to do subconsciously alter my diction a bit when the word is ambiguous from the context. I may use a slightly different voice inflection or stress or pacing to help disambiguate.

Think of someone lingering on a punned word to emphasize the joke, for example.

a_e_k··on A fourth of U.S. health visits now delivered by non-physicians
And for the routine stuff I often have a pretty good idea what's ailing me from past experience and I just need someone to write up the prescription again for whatever's worked well before. I have no problems with seeing an NP for that.

In some cases, an NP may have more current experience with figuring out the routine stuff than an MD who's a bit more removed from that kind of practice now.

a_e_k··on Every trick Microsoft pulled to make you browse Edge instead of Chrome
It's crazy. A year ago I changed jobs to a company invested in the MS ecosystem. When I got my Windows machines, I decided to give Edge a fair chance and left it as the default.

I gave it a few months, but I'm now back to good old Firefox.

(And I'm getting ready to give up on {New,} Outlook and go back to Thunderbird too. I'm sick of the paper cuts and I've wasted so much time fighting it to do what I want.)

← PreviousPage 7 of 25Next →