Better HN
topnewbestaskshowjobs
Log inSign up

physicles

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

Submissions

comment 5y ago · link · parent

Precisely. In a case at work, I’ve found that some YAML is complicated because the abstraction level at which it’s describing things is too low; the fix is to move a most of the logic into code and keep some minimal flexibility in the YAML (or use SQL instead, though that choice is more about who we want to empower to edit it).

comment 5y ago · link · parent

I read that about a decade ago and it helped me develop some of my opinions in these areas too.

One specific question I pondered around the time (I think Sagan may have raised it, but can’t remember for sure) was this: if we think about all the weird stuff that happens, the vast majority has a rational explanation that we can find, but for some extra weird events (let’s say 3%), what happened seems to require the supernatural, or aliens. How should we react to that 3%? Do we update our metaphysics? Or do we shrug and say “I don’t know, but absent better evidence I’m going to assume it wasn’t aliens”? How you answer that question determines your worldview.

This is where “extraordinary claims require extraordinary evidence” really hits home. It’s the main reason I’m able to avoid wasting brain power on fringe theories. If the evidence mounts, I’ll update my beliefs.

comment 5y ago · link · parent

Agreed. We're 100% Go in our back end, and in the process of hiring. We literally wrote in the job posting, "If you don't want to write Go, this job is not for you."

comment 5y ago · link · parent

If it drove them to write in another language, might that be a win? A code base full of non-idiomatic code, where devs think in the style of language A while using language B, isn’t a great place to hang out.

comment 5y ago · link · parent

> 64. DRY (don’t repeat yourself) is a luxury for when you have a coherent theory in your mind of the app’s code.

> It’s for when you have that theory contained in a worldview in your mind that helps you quickly test out decisions and plans against that theory.

> Until then, you should repeat yourself. Seeing your code repeat itself – when rhyming phrases start to pop up throughout – is a vital tool for building a theory about your app.

Wow, this is the best explanation of how to apply DRY that I've ever heard.

comment 5y ago · link · parent

I switched to Pop OS from Ubuntu about a year ago, and I love it. Stable, good battery life, everything just works. The auto-tiling works well, but what really made me faster was having dedicated keyboard shortcuts for specific apps.

For instance, Win+1 switches immediately to the open terminal window, and if it’s not already open, it opens it. Win+2 is the same for VS Code opened to the repo I work in most frequently. Win+3 for chrome, +4 for a text editor, etc. For comfort, on keyboards that don’t have a Win key on the right side, right ctrl gets rebound to that.

I don’t even need the dock anymore, because 95% of the time I’m switching between just a few apps. Alt+tab works for the remaining 5%.

comment 5y ago · link · parent

I’ve been using Joplin for about a year now too. My favorite feature is the totally seamless cross-platform sync. Honestly if Obsidian had better support for sync on e.g. Dropbox, I would’ve taken the plunge.

Joplin has its issues though. For instance, it seems confused about the format that it wants to store your notes in. Desktop search recently became useless too (no highlighting of search terms and ranking is broken).

comment 5y ago · link · parent

This is part of my threat model. Is there an easy way to do this with e.g. hosted RDS or block storage device snapshots?

comment 5y ago · link · parent

> up to the limit of the problem space.

This is the key. One of the harder things to do in software design is to find a representation of the problem that gets closest to that complexity floor. It's often not obvious.

comment 5y ago · link · parent

One of the best examples of this I can recall came from an operating systems class at uni, 15 years ago. The professor introduced a problem where two threads are trying to modify the same state at the same time.

Then, instead of saying “there are these atomic locking primitives that we can use,” he asked the class for suggestions about how to make sure the two threads don’t stomp on each other’s updates. For about a half hour, someone would suggest a new way to place an if statement, and he would show how the “lock” would be defeated if contexts switched in such-and-such way.

Finally, when the whole class was thoroughly convinced that it wasn’t possible, he introduced atomic locking primitives.

comment 5y ago · link · parent

This is our goal with E2E tests and monitoring — write tests that fail if and only if customers are experiencing issues — and I don’t know how to achieve that level of I-can-sleep-well-at-night assurance of quality without it. We run our E2E tests continuously against prod from a different cloud region.

As you wrote, the challenge is that there are literally 100 things that could cause a test to fail (some of which are outside your control), and as your team scales you’ll have to get smart about how to efficiently dispatch people to fix problems.

comment 5y ago · link · parent

There’s the classic diagram showing tests as a pyramid[1]. At the bottom you have unit tests, white box stuff that mocks all dependencies and runs super fast. At the top you have E2E tests (or acceptance tests or whatever, names are fungible), but very few of them, to catch bugs at the boundaries between systems. In the middle you have stuff that maybe runs against a live database instead of a mock.

As you go further up the pyramid, tests get more expensive in every dimension: they are slower (and are run less frequently as a result), more expensive to debug and maintain, and maybe a bit flaky, though you should still de-flakify these tests as much as is practical.

The key is to push tests as far down the pyramid as possible. Never test something in an E2E test if it can be meaningfully tested in a unit test. For example, a regression test for a database date/time serialization bug should run against a real database. Meanwhile, a test verifying that an HTTP service returns the correct response code in a specific situation can run against mocks.

1 https://martinfowler.com/articles/practical-test-pyramid.htm... (holy crap that is a mountain of text, but the diagram is near the top)

comment 5y ago · link · parent

Burst CPU and IOPS has bitten me a couple times over the years. In fact, it’s basically the sole cause of nearly all our downtime in recent history. That’s frustrating. I get that it’s a technical solution to the problem of resource utilization at scale, but they could’ve spent some time making it easier to observe — for example, rescale the CPU or IOPS graphs so that 100% is your max sustained budget, and anything over 100% eats into your quota.

comment 5y ago · link · parent

Yeah, I’ve routinely found work on internal tools to be the most satisfying. It’s rare to find product work where you’re directly in touch with users who care, and whose expectations you can routinely meet.

comment 5y ago · link · parent

Are there companies that would let you take the rest of the week off in that situation? If so, shouldn’t they also make you work overtime to finish some work that you underestimated?

Isn’t the trick to just work at a sustainable pace, day in and day out, and celebrate the wins along the way?

All that said, in the last five years my longest holiday has been a week. The work really is endless.

comment 5y ago · link · parent

Yeah unfortunately the Linux experience is still highly dependent on how well your hardware is supported, and whether you’re going to stick to the happy path (so not much gaming, photo/video editing, or coding in .NET).

I’m squarely in the linux happy path (I bought a Thinkpad because they’re known for good linux support) and it’s amazing, far better than Windows. But that’s also because staying in the happy path is a conscious choice: I actively avoid the stupid kinds of tech pain that eat entire weekends. For all that stuff I keep a Windows box around, which I power up once a month or so.

comment 5y ago · link · parent

PG is great for this. Should handle ~100 or more events per second without much work (but set up a retention policy, and watch out for tables growing to > ~1M rows, as that will kill you during autovacuum).

You can use txid_current_snapshot() and friends to track the last "timestamp". Proper use of locks will help you avoid the complexity associated with long-lived transactions.

Exactly-once semantics can be tricky to guarantee if you do it at the wrong layer of abstraction. Sometimes building exactly-once semantics on top of at-least-once semantics is the way to go.

Kafka and rabbit MQ are both overkill under 100 events/sec. The extra ops overhead isn't worth it. Besides, with PG it'll be nice to be able to always query a couple tables to completely discern the state of the system.

comment 5y ago · link · parent

I solved a similar problem last year. As others have said, your bottleneck is the compression scheme that PNG uses. Turning down the level of compression will help. If you can build a custom intermediate format, you'll see huge gains.

Here's what that custom format might look like.

(I'm guessing these images are gray scale, so the "raw" format is uint16 or uint32)

First, take the raw data and delta encode it. This is similar to PNG's concept of "filters" -- little processors that massage the data a bit to make it more compressible. Then, since most of the compression algorithms operate on unsigned ints, you'll need to apply zigzag encoding (this is superior to allowing integer underflow, as benchmarks will show).

Then, take a look at some of the dedicated integer compression algorithms. Examples: FastPFor (or TurboPFor), BP32, snappy, simple8b, and good ol' run length encoding. These are blazing fast compared to gzip.

In my use case, I didn't care how slow compression was, so I wrote an adaptive compressor that would try all compression profiles and select the smallest one.

Of course, benchmark everything.

comment 5y ago · link · parent

> I'm just wondering, what to do if the dashboard team creates a buggy & hard to use, worse than nothing, dashboard self service, and everyone is supposed/required to use it

That sounds like the situation in the OP's article. Maybe it would be best to address that as a political problem ("don't make us use this thing") instead of a technical one.

comment 5y ago · link · parent

You can also use this essay to examine opportunities and pitfalls of horizontal coordination across organizations.

I used to work at a big tech company, but now I’m one of a few cloud devs at a startup. One day we realized we needed a dashboard, so I spun up a server and put a single binary on it that saves data to SQLite and renders HTML server-side. Dumb stuff. Took 2 days, problem solved, been humming along for a year, no plans to rewrite it.

Now let’s say another dev decided that they wanted to build another dashboard to monitor a service they just built. Obviously I’m gonna insist that they add on to the stuff I already built. I show them where to add the function (literally one function that makes an HTTP request and returns an error), it takes them 10 minutes instead of 2 days, and doesn’t add another entry point for attackers.

But now let’s say our company now has 100 devs. There’s now more status info than can fit on a single page. If you don’t do this right, the dashboard communication/management overhead at some point grows larger than the cost to develop a new dashboard.

What the dashboard team in OP’s article should’ve done is to create a self-service solution for making a new dashboard: here’s a big template, fill in whatever health checks you need in one of N languages, and tell us when you’re done and we’ll spot check the code and deploy it for you. That way they maintain control of all the dashboards, and teams get their dashboards way faster.

(Am I missing a downside, other than that the dashboard team will need to downsize?)

comment 5y ago · link · parent

I think it’s rational. I started using Windows with… DOS 6. Of all my lifetime Windows installs, probably 70% are 98, 2k and XP. Yet I also agree that Windows 7 was peak Windows UX, probably because it was the final version designed to be used with a keyboard and mouse.

comment 5y ago · link · parent

I was also using Google Authenticator before I bought a new iPhone a few years ago, when I noticed to my surprise that those 2FA codes were the only thing that didn't automatically populate on my new phone. I immediately switched to Authy.

In my threat model, losing my phone is at least 1,000x more likely than the targeted attack it would take to compromise both auth factors for my most important accounts.

Besides, as others pointed out in another similar thread: after SMS hijacking and social engineering, the next weakest link is cookie theft.

comment 5y ago · link · parent

I’ve been using Ubuntu and now pop os on a Thinkpad for a couple years now, and I don’t miss Windows (which I used since…well, DOS 6) at all. Quite the opposite. As time goes on, seeing what’s happening with MacOS and Windows, I’m more and more happy that my computer is actually my computer.

comment 5y ago · link · parent

Thinkpads also run Linux very well. I've got an X1 Carbon 7th gen running Pop!_OS, and everything on the machine works, including the fancy microphones on top (haven't tried the fingerprint reader though).

comment 5y ago · link · parent

This seems to mitigate the specific threat where I gain non-root shell access to the container, but there's a root process running interpreted code, which I can modify.

However, if the container doesn't contain any processes running as root, there doesn't seem to be any benefit (besides defense in depth) to marking the code as read-only.

comment 5y ago · link · parent

PopOS on a Thinkpad is the best Linux experience I’ve ever had, by far. The far-field microphone even works.

comment 5y ago · link · parent

As always, “rational” is subjective. Pinyin, the transliteration scheme in use in this post (in use in the PRC since the 50s or so), is necessarily full of trade-offs.

Ch is already needed to represent a sound which is much closer to the English “Ch”, as in Chen. But then there is this other sound, which sounds superficially like Ch to a non-native speaker, but actually is quite different (and if you mix them up, you might not be understood by a native speaker). What letter do you use for that?

Originally people used Ts, as in Tsingtao the beer, named for the city on the coast (but that wasn’t perfect either, because the sound also has very little in common with T). Then in the 50s Pinyin came along and it was changed to Q, so Qingdao (the final consonant was changed too).

Btw this change in transliteration schemes is why Peking Duck is still a thing: even though the city’s name is now spelled Beijing, the old spelling of Peking lives on in the name of the dish (and a few other places).

comment 5y ago · link · parent

I did a mental double-take when I once listened to a friend in ad tech describe his business. To refer to people who used ad-rich apps, he used the word “inventory”. This inventory is what they were selling to their customers, the advertisers.

I’m sure this is old news to a lot of people, but the use of that specific word neatly and fully betrays the shift in perspective that is natural and necessary in ad tech.

I feel fortunate that I can comfortably choose to never work at an ad-supported business.

comment 5y ago · link · parent

“It should be noted that no ethically-trained software engineer would ever consent to write a DestroyBaghdad procedure. Basic professional ethics would instead require him to write a DestroyCity procedure, to which Baghdad could be given as a parameter.” - Nathaniel Borenstein

Quoted at https://blog.codinghorror.com/your-favorite-programming-quot...

comment 5y ago · link · parent

I had a very similar journey. Even after 10 years I sometimes still slip into existential despair, and the remedy is, as you said, a bit subtle: don’t outright ignore it, but also don’t attack it directly. No matter how hard you stare into the void, you will never see anything but darkness.

It’s a bit like happiness: if you pursue happiness directly, you will surely fail. Instead, pursue worthy goals and care for others, and happiness will take care of itself.

I also learned that, as you wrote, we can lean on human biology. If one asks, “Why should I wish to strive to make progress in life and keep living?” the a suitable answer is simply “Because I’m human and that’s how I’m wired.”

1
171819
22