1,822 karma · joined Feb 3, 2019 (7y ago) · 645 submissions
comment 5y ago · link · parent
comment 5y ago · link · parent
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
> 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
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
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
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
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
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
comment 5y ago · link · parent
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
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
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
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
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
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
comment 5y ago · link · parent
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
comment 5y ago · link · parent
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
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’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
Quoted at https://blog.codinghorror.com/your-favorite-programming-quot...
comment 5y ago · link · parent
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.”