Better HN
topnewbestaskshowjobs
Log inSign up

physicles

1,822 karma · joined Feb 3, 2019 (7y ago) · 645 submissions

Submissions

comment 1y ago · link · parent

I had this problem on the latest Pop OS LTS (I know, I know). Took about 4 hours to find the magic incantation that would let me install podman >= 4 without breaking anything else.

comment 1y ago · link · parent

Could you describe what made those tests effective? I just wrote some tools to write concise tests for some analytics queries, and some principles I stumbled on are:

- input data should be pseudorandom, so the chance of a test being “accidentally correct” is minimized

- you need a way to verify only part of the result set. Or, at the very least, a way to write tests so that if you add a column to the result set, your test doesn’t automatically break

In addition, I added CSV exports so you can verify the results by hand, and hot-reload for queries with CTEs — if you change a .sql file then it will immediately rerun each CTE incrementally and show you which ones’ output changed.

comment 1y ago · link · parent

Who did you buy your domain from?

comment 1y ago · link · parent

I’m trying to choose between Ente and Immich. What helped you make your choice?

comment 1y ago · link · parent

Love the visualization, and the scenario of sharing your real-time location with anyone is important. I don’t know if Uber has that built-in, but Didi (in China) does and I use it frequently.

If anyone’s looking for a more plug-and-play option on iOS, I’ve been using Arc Timeline for nearly two years and it just dumps reasonably accurate .gpx files into your iCloud Drive without using too much battery. I use it for visualizing working locations and other activities on a weekly timeline.

comment 1y ago · link · parent

That’s funny, I assumed it was called Kafka because the act of processing items in a queue over and over could be described as kafkaesque.

comment 1y ago · link · parent

Totally agree with this. I’ll add that replaying your data needs special tooling to 1) find the correct offsets on each topic, and 2) spin up whatever daemon will consume that data out-of-band from normal processing, and shut it down when completed.

I don’t remember where I read this, but someone made the observation that writing a stream processing system is about 3x harder than writing a batch system, exactly for all the reasons you mentioned. I’m looking at replacing some of our Kafka usage with a clickhouse table that’s ordered and partitioned by insertion time, because if I want to do stuff with that data stream, at least I can do a damn SQL query.

comment 1y ago · link · parent

MQTT and Kafka solve different problems. At my current company, we use both.

Kafka isn’t a queue. It’s overkill to use it as one.

Kafka is a great place to persist data for minutes, hours or days before it’s processed. It fully decouples producers and consumers. It’s also stupidly complex and very hard to operate reliably in an HA configuration.

MQTT is good for when data needs to leave or enter your cloud, but persistence is bolted on (at least it is in mosquitto), so a crash means lost data even though you got a PUBACK.

comment 1y ago · link · parent

Reminded me of this gem from Brian Kernighan:

"Everyone knows that debugging is twice as hard as writing a program in the first place. So if you're as clever as you can be when you write it, how will you ever debug it?"

comment 1y ago · link · parent

Are there good tools that can dump a database schema to files that are human- and AI-readable?

We use migrations as the source of truth for the prod database schema, but they’re also a pain when you want to just see the latest version of a table or a stored procedure.

comment 1y ago · link · parent

I’m finally waking up to how great views are for building abstractions within the database. They’re not as versatile as actual code, but still worth thinking about.

Triggers, however… as the years have gone by, I like triggers less and less. Triggers for complex validation are ok, but triggers that mutate data are a code smell. Our database contains some triggers that denormalize data to make some queries faster, and they’ve proven to be an endless source of problems.

comment 1y ago · link · parent

Data on the impact that such measures would have, should they decide to implement them in the future.

comment 1y ago · link · parent

The author wrote a book, for which RST is undoubtedly the better choice. ("I wrote a book in Markdown" would be a surprising headline!)

But it's overkill for light documentation. Just look at their first example of embedding an image:

> ![alttext](example.jpg)

vs

> .. image:: example.jpg

> :alt: alttext

In the first one, it's just the syntax for a hyperlink with ! in front.

In the second one, there are several bits of syntax to remember. We have .. and then whitespace, and not one but two colons after `image`, and it's not `alt:` but `:alt:`.

I don't have to try to remember Markdown syntax, because it's simpler and it's ubiquitous. I type Markdown directly into Slack and Obsidian every day. Most tech-adjacent people know some Markdown.

Many years back a developer on my team decided that all the readmes that live next to source code should be in RST, because it's Better(TM) and we could have nicely formatted generated docs. The result was that a lot less documentation got written, and nobody looked at the generated docs anyway. Eventually we transitioned back.

comment 1y ago · link · parent

“Falsehood flies, and the Truth comes limping after it”

- Jonathan Swift

comment 1y ago · link · parent

As other commenters and TFA have pointed out, that “just” is doing a lot of heavy lifting

comment 1y ago · link · parent

There is a certain point where UX responsiveness has a huge impact on how the product gets used.

I hate Jira with a burning passion simply because it is slow where I live (in China, with a VPN). Even minor interactions, like clicking on a task’s description to edit it, takes about 2 seconds. Opening a task from a list takes around 5 seconds.

The result is that I and my coworkers avoid using Jira unless we really have to. Ad-hoc work that wasn’t planned as part of the sprint just doesn’t get tracked because doing so is unreasonably painful.

comment 1y ago · link · parent

Why would Spotify care about what’s fair?

comment 1y ago · link · parent

Back in 2011, I wasted an entire afternoon on some string handling code that was behaving very strangely (I don’t remember exactly what the code was).

It wasn’t until I loaded the content into a hex editor that I learned about U+00A0, the non-breaking space. Looks like a space, but isn’t.

comment 1y ago · link · parent

Indeed. As an American, I found The Rest Is History’s four part series on the American war for independence particularly enlightening.

comment 1y ago · link · parent

Years ago I built a slippy map (google maps-style) tile server for non-image data. One of the use cases was to be able to quickly sample elevation data at an arbitrary lat/lng in a few milliseconds.

The data set is so large that you obviously want to delay decompression as long as possible. I turned to 16-bit grayscale PNGs, because PNG is a widely-used a standard. These were fine, but I wasn't close to my target latency.

After some experimentation, I was surprised to discover two things:

1. Deflate, this widely used standard, is just super slow compared to other algorithms (at least, in Go's native PNG decoder)

2. Tool and library support for formats other than ARGB32 is pretty lacking

So I turned to some bespoke integer compression algorithms like Snappy and Simple8b, and got a 20x decompression speedup, with maybe 20% worse compression ratios. This, along with some other tricks, got me where I needed to go.

Maybe there are some niche file formats out there that would've solved this. But in total we're not even talking about that much code, so it was easier to just invent my own.

comment 1y ago · link · parent

I want to do this too, but what’s your threat model around losing access to your domain name?

To maintain a Gmail account, you need to:

1. Do nothing

2. Don’t be unlucky

To maintain a domain name, you need to:

1. Keep a functioning credit card forever

2. Make sure the domain name is renewed forever

3. Take action if your registrar goes out of business

The odds of something going wrong with your domain name, while still low, seem higher. Are you banking on the fact that you can talk to a human at your registrar to resolve issues?

comment 1y ago · link · parent

Well, you can continue to make fun of her because, fortunately, this has turned out to be basically nothing (for Japan, anyway).

comment 1y ago · link · parent

This is a developer flex if I ever heard one

comment 1y ago · link · parent

My friends and I used Hamachi in the early 2000s to play StarCraft and other games over the internet without involving online services. Worked great. I’ve got a soft spot for it.

comment 1y ago · link · parent

In the US at least, most housing-related problems are political, no? There was an article here in the last week talking about manufactured housing in particular and all the regulations that make it infeasible.

comment 1y ago · link · parent

I’ll echo what others are saying about four days preventing burnout and leaving mental space for other activities.

Just for last year, I went back to five days to get something out the door. Being there every day with my team was nice, and I balanced the heavy mental work with exercise at night or on weekends. But hobby coding — or writing or anything requiring mental juice — stopped entirely. By the end of the year as we got close to shipping, I was drifting into that “what the hell am I spending my life for” mindset.

Going back to four days this year fixed it. Each work day is still mentally exhausting, but I’ve been using my day off for personal stuff and, randomly, to practice slack lining with a small group of flexible friends. I’m so grateful to have this option.

comment 1y ago · link · parent

This fact is one of the most pleasant surprises I’ve had during this AI wave. Finally, a concrete reason to care about your docs and your code quality.

comment 1y ago · link · parent

Cursor is an IDE. You can use its powerful (but occasionally wrong) autocomplete, and start asking it to do small coding tasks using the Ctrl+L side window.

comment 1y ago · link · parent

We use kustomize because we have four environments that run basically the same stuff (dev with k3s, test, and two cloud regions). If we didn’t use kustomize, we’d be forced to reinvent it to avoid duplicating so much yaml.

comment 1y ago · link · parent

Tab autocomplete in Cursor is surprisingly good at guessing what I want to log when I type slog.Info. I’m enjoying that time save.

I agree with K&R about debuggers: when writing services that you need to debug in prod, you live and die by your logs. That said, sometimes an interactive debugger is faster than adding logs, like when you’re not sure about the precise call stack that leads to a given point, or there’s a bunch of stuff you need to keep track of and adding logs for all of it is tedious. But pretty quickly you can hit a point where you’re wasting more time in the debugger than it would’ve taken to add those logs…

1
456
22