HN user

sigil

3,693 karma

alangrow.com

Posts65
Comments703
View on HN
alangrow.com 1y ago

Mental Models and Potemkin Understanding in LLMs

sigil
1pts0
www.discovermagazine.com 1y ago

Quantum Algorithm Solves Travelling Salesperson Problem with 1-Qubit

sigil
3pts1
blog.wolfram.com 2y ago

How I Made Wine Glasses from Sunflowers (2011)

sigil
1pts0
www.discovermagazine.com 2y ago

Why Warp Drives Are About to Get Better

sigil
4pts1
alangrow.com 2y ago

What Letter-Pair Tileset Forms the Most Words?

sigil
5pts2
github.com 2y ago

Monero Community Crowdfunding System (CCS) Wallet Hacked and Drained

sigil
4pts3
brandur.org 3y ago

A ChatGPT-authored article hit the front page of HN this morning

sigil
15pts8
johnhawks.net 3y ago

Discoveries about ancient people from DNA in 2022

sigil
3pts0
www.discovermagazine.com 3y ago

Adversarial Attack Beats Near-Superhuman AI Go Player

sigil
1pts1
www.overcomingbias.com 3y ago

AGI Is Sacred

sigil
4pts0
endcrawl.com 4y ago

Ordering movie credits with graph theory

sigil
210pts63
twitter.com 4y ago

Log4j Worm Under Development

sigil
1pts0
taras.glek.net 4y ago

Optimized Zip Format: Reading Zip Files Quickly

sigil
10pts0
news.ycombinator.com 4y ago

Tell HN: Major GCP Outage? (Spotify, Discord down)

sigil
59pts1
www2.nau.edu 4y ago

The Origin of Cultivated Fruits and Vegetables

sigil
2pts0
austinvernon.site 4y ago

Geothermal's Path to Relevance: Cheap Drilling

sigil
2pts0
scattered-thoughts.net 4y ago

Reflections on a Decade of Coding, Part 6: Moving Faster

sigil
5pts0
www.workpump.com 4y ago

The Bug Count Also Rises (1996)

sigil
25pts2
whitehoodhacker.net 4y ago

IoT Hacking and Rickrolling My High School District

sigil
2pts0
www.youtube.com 4y ago

How to avoid being hit by a laser in a room of mirrors [video]

sigil
262pts91
fishdraw.glitch.me 4y ago

Fishdraw: Procedurally Generated Fish Drawings

sigil
614pts87
www.youtube.com 4y ago

How to avoid being hit by a laser in a room of mirrors [video]

sigil
4pts0
alangrow.com 5y ago

Music To Program To

sigil
3pts0
arxiv.org 5y ago

A Simple Model of Grabby Aliens

sigil
1pts0
twitter.com 5y ago

N501Y is an antibody escape mutation (paper)

sigil
2pts0
www.workpump.com 5y ago

The Bug Count Also Rises (1996)

sigil
1pts0
apenwarr.ca 5y ago

A log/event processing pipeline you can't have (2019)

sigil
162pts40
dcgross.com 6y ago

Building in World 2.0

sigil
2pts0
www.oilshell.org 6y ago

Oil's Parser Is 160x to 200x Faster Than It Was 2 Years Ago

sigil
3pts0
erikbern.com 6y ago

Trying to improve buffet lines using simulations

sigil
144pts54

I believe the bounding box has to fit all the possible ascenders and descenders etc., so the em-height is proportioned within the box to whatever the highest and lowest marks in the typeface are.

I wish it were this simple.

The em square != the bounding box of all glyphs. The em square is defined by the font's ascent & descent vertical metrics, which are set by the font designer.

There are reasons why you might want glyphs to escape the em square. Perhaps you're typesetting English text without accent marks above capitals, and using the bounding box's vertical maximum would introduce too much line space. Or perhaps you're using a decorative font which is designed to escape the em square, and potentially even overlap the em squares of lines above and below, like this: https://alangrow.com/images/blog/script-font-escaping-em-squ...

To make matters worse, and mostly for legacy reasons, there are THREE different sets of ascent & descent metrics in a font file. Which is used depends on your OS and the software rendering the font. But the Webfont Strategy described here is a nice one, because you can use the bounding box (winAscent & winDescent) if you really need to, say because any glyph might be used and you want to avoid em square escape: https://glyphsapp.com/learn/vertical-metrics

This nginx local dev config snippet is one-and-done:

  # Proxy to a backend server based on the hostname.
  if (-d vhosts/$host) {
    proxy_pass http://unix:vhosts/$host/server.sock;
    break;
  }
Your local dev servers must listen on a unix domain socket, and you must drop a symlink to them at eg /var/lib/nginx/vhosts/inclouds.localhost/server.sock.

Not a single command, and you still have to add hostname resolution. But you don't have to programmatically edit config files or restart the proxy to stand up a new dev server!

Gleick's "Chaos" got me sent to the principal's office in high school. I went crazy for fractals. Unfortunately all I had at home was an IBM PC XT. Mandelbrot set renderings were agonizingly slow and the CGA palette was too limiting.

Around this time my co-conspirator and I realized the library had 386s that almost no one was using for catalog search. They became our fractal render farm. We'd exit the catalog program, insert a floppy with our latest renderer, kick off a deep zoom, and turn off the monitors to avoid suspicion until we could check back next period. The results were thrilling. What a difference the access to compute made.

You all know the story -- eventually the librarian found us out and reported us for "hacking."

Who was the first person to propose FFTs for faster polynomial multiplication?

Got curious about this recently. I’m not great at citation tracing, but did make it back to this 1995 paper by David Eppstein [0] where he uses it to efficiently solve Subset Sum after an incremental update. Surely Knuth’s TAOCP had it even earlier?

The fact that FFT polynomial multiplication also lets you solve Exact Subset Sum with Repetition in sub-exponential time came as a real shock to me. [1] Crucially, this algo is O(N log N) where N = the maximum element, not N = the set size, so it isn’t a P ≠ NP counterexample or anything.

[0] https://escholarship.org/content/qt6sd695gn/qt6sd695gn.pdf

[1] https://x.com/festivitymn/status/1788362552998580473?s=46&t=...

Sure, but how often do you need to touch that config?

More often than I’d like! tmux config has broken backwards compatibility on me multiple times over the years.

This is fine for most software — you upgrade your config once and you’re done. However, the nature of tmux is that I use it on many servers, some old and some new, some with tmux 1.x and some with 2.x. Getting a ~/.tmux.conf from my dotfiles repo that works across both has been papercutty.

Love tmux though & can’t imagine tty life without it — I run it locally as well as on remote machines.

And on a related note, Lewis Mumford, a philosopher and writer, wrote quite a bit about how clocks were (in his view) the necessary invention for capitalism to flourish.

Szabo also takes this up in his excellent essay "A Measure of Sacrifice":

Fair broadcast and verification of time was thus of fundamental importance to the most common contractual relationship in the new European cities. In agricultural societies, including medieval Europe, serfdom and slavery had provided most of the labor. Most workers in a modern economy earn wages based on a time rate. Along with or following the rise of the time-rate institution – including the contracts themselves, the laws and regulations governing the contracts, and the technology to fairly measure the principal quantity – came the growth of related economic institutions, such as the joint stock company. These institutions enabled a boom in productivity and the spectacular rise of Europe from its darkest ages to the modern era. We will now chart the rise of the clocks and the institutions they supported.

https://www.fon.hum.uva.nl/rob/Courses/InformationInSpeech/C...

HTML can be described by a context-free grammar [0], but not by a regular grammar [1]. If a language can be described by a regular grammar, you can parse it with a regular expression -- that's where the "regular" in RegExp comes from!

Derivatives of RegExps don't automatically unlock parsing of context-free grammars, afaik. For that you need recursion. They do however unlock some very elegant parser designs.

[0] https://en.wikipedia.org/wiki/Context-free_grammar

[1] https://en.wikipedia.org/wiki/Regular_grammar

You do realize D-Bus also uses SO_PEERCRED right? And transitively polkit, systemd, and everything in that ecosystem.

https://gitlab.freedesktop.org/dbus/dbus/-/blob/master/dbus/...

Meaning you have to be incredibly careful what you do when creating the socket and you cannot really pass any sockets off to other processes if you want to try to do security that way because they will still inherit the wrong credentials.

I see nothing new here beyond "handle privileged resources with care." Don't overshare. Got an open pipe to `sh` running as root? Maybe you oughtta set O_CLOEXEC on that fd before you exec and overshare with a child. Got a socket that's been peer authed? The same.

This is pretty basic unix stuff. If you stick to the basics and avoid the siren call of complexity, the security properties remain relatively easy to reason about. Most privileged resources are fds. Mind your fds.

I'm not a huge fan of sending file descriptors over sockets – maybe we agree on that part.

I like s6! One of the key differences here is that s6-sudo builds on, rather than replaces, the standard unix permissions model.

s6-sudod listens on a unix domain socket. Unix domain sockets are just files, so they have an owner, group and mode bits. The answer to "who is potentially allowed to run a differently-privileged command?" is just `ls -l /path/to.sock`.

For finer-grained access control, a unix domain socket listener can call `getpeereuid()` or `getsockopt(..., SO_PEERCRED, ...)` to learn who it's talking to. You can build powerful – but still relatively simple, and importantly, readily-inspectable – access control policy on top of these basic unix primitives. That's what s6 does. Look at how simple rule definition is. [0]

Or, you could throw all that out the window and build something much more complex and much less inspectable, which is the systemd approach. The answer to "who is potentially allowed to run a differently-privileged command?" under `run0` is to...spend the evening reading through polkit xml rules, I guess?

I realize systemd uses D-Bus, and D-Bus uses a unix domain socket. But that socket is writable by world. We're trusting polkit and complex policy xml and probably a constellation of other services to get things right after the SO_PEERCRED check.

Maybe that's fine for desktop apps, but a reminder that we're talking about sudo here.

Complexity is the enemy of security. The complexity of the systemd ecosystem broadly writ is how we get CVEs like this polkit privesc, which took 12 years to notice [1].

Addendum: it's possible to regard systemd as dangerously complex AND sudo as dangerously complex. OpenBSD as usual had the right idea with `doas`.

[0] https://skarnet.org/software/s6/s6-accessrules-cdb-from-fs.h...

[1] https://www.cvedetails.com/cve/CVE-2021-4034/

Good question! Here's a paper, "Build systems à la carte: Theory and practice," that compares Make, Shake, Bazel, and Excel:

https://ndmitchell.com/downloads/paper-build_systems_a_la_ca...

Yes, Excel can be considered a build system! A cell outputs the result of a computation, but it can also input computation results from other cells. For performance reasons, you don't want to recompute all cells in a spreadsheet when one cell changes. You want to do the minimum – an incremental rebuild. You do that by traversing a DAG with cells as vertices. You might not be "compiling" "files", but it sure looks like a build system in other important ways.

I've worked on build systems on & off for most of my career, but your question made me realize I've never read a book that presents build systems in the abstract. Everything I know comes from studying specific build systems and, in some cases, writing my own. The design space for build systems is huge and still expanding. That makes a unified theory of build systems difficult.

Can you share what motivated your question and what you're hoping to learn?

Meta outage 2 years ago

My FB password is 96 bits from /dev/urandom in a GPG-based password manager I wrote for myself a couple decades ago.

We have the same approach to password management!

Incredible reply, thanks! The Mandelbrot set is my Hello World when learning new graphics APIs, and I was learning WebGL with it recently. Immediately ran into the precision issues you describe in [2]!

Topaz Unicode 2 years ago

I had a CGA graphics card, and it’s quite possible I’m remembering the CGA-2y font!

Topaz Unicode 2 years ago

You’re right. Topaz is eerily familiar though, and I never used an Amiga. Wondering if a well-known MSDOS program used it. Turbo Pascal?