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 Even Microsoft Notepad is getting AI text editing now
Wow. I'd totally missed the Settings screen. Tiny little gear icon on the right...

(And cute: it spins when I click it. Blech.)

a_e_k··on Soft matter mechanics of baseball's Rubbing Mud
> there is only a single buyer for the mud

Monopsony!

a_e_k··on How to Train Yourself to Go to Sleep Earlier
I like to sleep on my back, but with a pillow over my forehead and eyes (i.e., nose and mouth exposed to fresh air).
a_e_k··on How Gothic architecture became spooky
My first thought when I read the article was that that image must have been run through something like a contrast-limited adaptive histogram equalization (CLAHE) process.

See here, for an example: https://imagemagick.org/script/clahe.php

a_e_k··on Infinite Git repos on Cloudflare workers
Crazy thought: something like BorgBackup.

If only 20% of the content gets changed, the rolling hash that Borg does to chunk files could identify the 80% common parts and then with its deduplication it would store just a single compressed copy of those chunks. And as a bonus, it's designed for handling historical data.

a_e_k··on Zero or Sign Extend
That was the first alternative that I thought of. Experimenting with this:

    int sign_extend(int val_11b) {
        struct { int v : 11; } t = { val_11b };
        return t.v;
    }
in Compiler Explorer produces pretty much the same x86-64 assembly as the first function in the post (the shift left, then shift right version) under GCC, Clang, and MSVC when optimizations are turned on.

https://godbolt.org/z/d3Kf9fsE6

(But I do love that xor variant; that's really clever and clean.)

a_e_k··on What makes a person seem wise?
The famous "Your scientists were so preoccupied with whether they could, they didn't stop to think if they should" line from Jurassic Park comes to mind.
a_e_k··on Florida domed homes have survived category 5 hurricanes
Is it the shape or the material?

I notice that the destroyed house next to it seems to have been made of the typical light timber frame and regular glass windows.

By comparison, my parents' house in Puerto Rico isn't dome-shaped -- it's rather boxy, but it is constructed with fairly thick concrete walls on the exterior and has hurricane shutters over all the windows. The biggest problem that it's ever had from hurricanes (e.g., Hurricane Maria) has been from flooding and extended loss of power rather than anything structural.

a_e_k··on The mystery of why left-handers are so much rarer (2016)
I'm exactly the same on all those (and add kicking to the right-sided list). Cross-dominant [1] is the usual term I use for it.

[1] https://en.wikipedia.org/wiki/Cross-dominance

a_e_k··on The magic (image resampling) kernel
> Basically it is trying to squeeze blood from a stone and the image out of renderer is going to be far sharper than anyone will see because it will go through multiple stages. Even compositing almost never leaves a render verbatim.

Don't forget that these days, it's all going through some ML-based denoiser, anyway. I wouldn't be surprised if filter choice is nearly irrelevant at this point (except for training).

a_e_k··on The magic (image resampling) kernel
Historically, Pixar's RenderMan defaulted to a 2x2 Gaussian filter [1], and from what I can see, that hasn't changed [2].

Essentially it uses a truncated isotropic (non-separable) Gaussian defined by exp(-2.0 * (x*x + y*y)) with a 2x2 pixel support [3], which is slightly soft and completely avoids ringing.

Gaussian also plays very nicely with filtered importance sampling [4] since it has no negative lobes.

(Though I remember a number of studios using RenderMan preferring filters with a bit of sharpening.)

[1] https://paulbourke.net/dataformats/rib/RISpec3_2.pdf#page=40

[2] https://rmanwiki-26.pixar.com/space/REN26/19661819/Filtering

[3] https://paulbourke.net/dataformats/rib/RISpec3_2.pdf#page=20...

[4] https://citeseerx.ist.psu.edu/document?repid=rep1&type=pdf&d...

a_e_k··on The other British invasion: how UK lingo conquered the US
Archaic spelling of "jail". Read it with a soft g and a long a and it makes a little more sense. There's also the derivative "gaoler".

(American here, but that's one I've come across before.)

a_e_k··on The other British invasion: how UK lingo conquered the US
Okay, now that last one is just hilarious.
a_e_k··on The other British invasion: how UK lingo conquered the US
I'm not sure about other Americans, but I'll sometimes say "swim[ming] trunks" if I'm specifically referring to male swimming attire. Otherwise, yeah, it's often "swim[ming] suit" or "bathing suit" here.
a_e_k··on Holy Hell, the Social Web Did Not Begin in 2008
If we're just talking web, I'm old enough to remember web rings [0].

[0] https://en.wikipedia.org/wiki/Webring

a_e_k··on Rotation-Based Compression
Right. The lossiness in JPEG comes from quantization of the DCT coefficients. But with the way the DCT works:

- You can flip a block horizontally, left-to-right, by negating the DCT coefficients in the odd-numbered columns (zero-indexed).

- You can flip a block vertically, top-to-bottom, by negating the DCT coefficients in the odd-numbered rows (zero-indexed).

- You can transpose a block by transposing the DCT coefficients.

In combination, that's enough to rotate a block in 90 degree increments, and to do so losslessly/reversibly without harming the original quantization (you don't even need to do an IDCT). Then you swap the blocks around to the right order and redo the lossless entropy encoding stages.

a_e_k··on Caught on camera: Satellite tracker photographs secret spacecraft
From the same guy:

https://www.space.com/china-space-plane-caught-on-camera

a_e_k··on Atkinson Hyperlegible Font
I used a reverse-slashed zero in my programming font [1][2] for exactly that reason. I wanted it to be clearly distinct from an O with stroke (and by more than just the slash not extending past the bowl).

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

[2] https://usemodify.com/fonts/luculent/

a_e_k··on NASA Pulls Off Delicate Thruster Swap, Keeping Voyager 1 Mission Alive
I continue to be fascinated by how they:

1. Are able to diagnose the problems remotely at such distances and on such old hardware. How can they even measure the thruster tube apertures here?

2. Decide what actions to take. It's not like they have a local test device to experiment on is it? (Even if they did I can't imagine how they'd reproduce the conditions of the real thing.) And if they choose poorly, I'd assume the mission's over. There's no replacing Voyager 1 if they brick it.

3. Have such fine control over the hardware. For something built in the 70's when RAM was largely measured in kB, they seem to have an insane amount of flexibility to remotely reconfigure the equipment. Whatever they did, there must have been some real foresight.

a_e_k··on Greppability is an underrated code metric
I've come to really like language servers for big personal and work projects where I already have my tools configured and tuned for efficiently working with it.

But being able to grep is really nice when trying to figure out something out about a source tree that I don't yet have set up to compile, nor am I a developer of. I.e., I've downloaded the source for a tool I've been using pre-built binaries of and am now trying to trace why I might be getting a particular error.

a_e_k··on Floating points between zero and one
> So, in some code it can make sense to "zap" subnormals, converting them to zero since they're almost zero anyway.

Flush to zero (FTZ) is the usual term for this.

a_e_k··on Diffusion models are real-time game engines
Watch closely in the videos and you'll see that enemies often respawn when offscreen and sometimes when onscreen. Destroyed barrels come back, ammo count and health fluctuates weirdly, etc. It's still impressive, but its not perfect in that regard.
a_e_k··on Senior Intel CPU architects splinter to develop RISC-V processors
The headline may be misleading. It initially read to me as though Intel is forming a new division to work on this. Instead, these folks are going to a new startup outside of Intel.
a_e_k··on Writing a Rust compiler in C
FWIW, (i.e., for some historical fun) Dr. Dobbs Journal published a program called "Small C Compiler" by Ron Cain back in 1980. [1]

Later, it was expanded by James Hendrix into a full book with a more complete implementation. [2] (As a kid, coming across this book in the bargain bin at CompUSA was what led to me learning C. I still have my copy!)

[1] https://archive.org/details/dr_dobbs_journal_vol_05_201803/p...

[2] https://www.amazon.com/Small-Compiler-Language-Theory-Design...

a_e_k··on Celebrating 6 years since Valve announced Steam Play Proton for Linux
I've seen it joked that with Proton, Win32 is a good stable ABI for gaming on Linux.

Given that, and that I'm most comfortable developing on Linux and in C++, does anyone have a good toolchain recommendation for cross compiling C++ to Windows from Linux? (Ideally something that I can point CMake at and get a build that I can test in Proton.)

a_e_k··on Do low-level optimizations matter? Faster quicksort with cmov (2020)
They can, yes.

For example, here's a simple Compiler Explorer link with a simple loop conditionally copying from one of two values:

https://godbolt.org/z/TbeK99sx1.

If you look at the assembly code produced, you'll see in lines 9-11, it's doing a similar thing as the swap_if() function: ANDing one value with the mask, ANDing the other with the negation of the mask, and then ORing them together. And it produced that automatically from the ternary in the loop.

They can also do things like automatically generate epilogues with a serial loop to handle the leftover items if the loop count isn't an even multiple of the SIMD width. That's something else that I remember writing by hand before autovectorizers.

That said, coaxing an autovectorizer to actually vectorize a loop can be an art in itself. They're notoriously finicky. My favorite used to be the one in the old ("classic") ICC compiler where you use compiler flags to get a nice optimization report which would explain exactly why it chose what it did for each loop. You could also set #pragma's which would noisily warn or error out if the associated loop failed to vectorize for some reason.

(And of course, a lot of this stuff you might just use GPU compute for now.)

a_e_k··on Do low-level optimizations matter? Faster quicksort with cmov (2020)
This sort of use of turning conditionals into bitmasks and then shuffling masked values around was fairly common back in the day when writing code for SSE intrinsics.

You wouldn't want to have to check each lane individually since that would spoil the point of using SSE. So you'd write masking ops like this and keep things parallel, tThen judiciously use any() and all() type intrinsics to check whether the lanes could agree to skip certain blocks conditionally.

(This was before ISPC and before autovectorization to handle it for you.)

a_e_k··on The waiting time paradox: why is my bus always late? (2018)
The difference is that it was a one-and-done thing rather than leapfrogging back and forth as it sounds like `theluketaylor` was describing.

And yes, the drivers would coordinate. (I've sometimes seen it done with a brief honk for attention followed by a hand wave.)

a_e_k··on The waiting time paradox: why is my bus always late? (2018)
Another simple strategy that I've seen is simply for the loaded bus to allow the empty bus to overtake it and go on ahead (and just stay ahead).
a_e_k··on The anatomy of a 2AM mental breakdown
That mantra reminds me of "Any problem that goes away by itself can just as easily come back by itself."
← PreviousPage 5 of 25Next →