1,822 karma · joined Feb 3, 2019 (7y ago) · 645 submissions
comment 1y ago · link · parent
- 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
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
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
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
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
But it's overkill for light documentation. Just look at their first example of embedding an image:
> 
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
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
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
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
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
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
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…