Recent submissions

Comment · 17 days ago
During an internship I worked on optical transport network equipment. Most customers were either submarine or long-haul across land. I was told that many clients would design redundantly, mainly due to people digging up the cables, chopping them in half with a shovel, and being disappointed when there was not much copper to steal.
Comment · 1 month ago
Quebec gets weird with their french rules. Parents are not allowed to send their kids to English speaking schools if both of the parents did their own schooling in French.
Comment · 1 month ago
I started programming when Java 6 was relatively new. Back then it was about 3-4 years in between releases. Although I don’t write much Java any more, I’m happy to see changes shipping more frequently now.
Comment · 2 months ago
I interviewed with Microsoft at the end of 2016 as a new grad and was given the same marble question over the phone. I then made it to the on site interview where I failed horribly haha.
Comment · 3 months ago
IMO a release workflow would be better with something like this:

1) Upload all files in a staging state. Can be done asynchronously via multiple build hosts. Files in this state are referenced via their cryptographic checksums (e.g. SHA, Blake, etc)

2) Make visible with a single call by providing a manifest with checksums for all source dists/wheels contained in the release. All artifacts are made visible atomically and the release is immutable.

That allows authors to prepare uploads over however many days they need to coordinate hardware, but doesn’t allow for users to discover a release in a partial state.

Comment · 3 months ago
What exactly isn’t a language feature? Or do you have issues with semantics?

    var _ Foo = (*Bar)(nil)
The statement asserts that Bar struct pointers are assignable to a Foo interface.

I do agree it’s not as clean looking as the Java implements keyword, but it’s already a fairly terse pattern and IMO the inconvenience does not justify introducing new language syntax.

Comment · 3 months ago
How is a package level interface check a “language hack”? They are straight forward and provide a user the same compile time guarantees as the Java implements keyword.
Comment · 3 months ago
> Isn’t this a symptom of structural/duck typing where interfaces are not declared

Yes, essentially duck typing. See https://github.com/golang/go/blob/65504872cbca64d77f45828409...

The logic uses a type assertion to safely verify if the value backing the provided io.Reader interface also implements the io.ReaderFrom interface. If it matches, then it will use the more efficient implementation

    if rf, ok := dst.(ReaderFrom); ok {
        return rf.ReadFrom(src)
    }
> In Java for all its faults this wouldn’t happen because you’d be forced to implement all the interfaces.

I don't think I would go that far. In Java, many libraries make heavy use of the `instanceof` keyword, which is more or less the same as Go type assertions.

Comment · 3 months ago
sendfile(2) and io.ReaderFrom both return the number of bytes transmitted. The issue is that users are unaware of (or forget about) the optional interface upgrades and fail to define all the methods required for interface upgrades on their wrapper structs. You can definitely make a counting reader with a minimal performance loss, but the proper solution is less obvious than it ideally should be.
Comment · 4 months ago
We did do a lot of work sealing the exterior of the home, as well as removal of bird feeders near the house itself. The poison likely wasn’t a silver bullet, but I recall it (along with removing any access to easy food) having the most dramatic impact overall.
Comment · 4 months ago
One is not really better, you want both. Certificate revocation lists are loaded out of band and depending on the client can be poorly enforced.

Questions come up: do you block a request if you fail to download the latest CRL? How often do you refresh it?

When the cert expires, it can be removed from the CRL, so shorter lived certs will allow CRLs to be smaller and faster to transfer.

Comment · 4 months ago
When we had mice in our house years ago, we tried for a few weeks setting poison bait in the garage to get rid of them. We could tell the mice were eating the bait, but there was still no end to the mice.

We then had a thought... what if the mice were also eating the dog food in the garage? The container lid for the dog food was not very strong (weak and flexible enough that a mouse could possibly squeeze in and out), and coincidentally, that dog food was also high in Vitamin K.

Once we got better sealed containers to store the dog food, it only took a few days before we started seeing delirious, sick mice running around aimlessly in plain day light. Shortly after that, we stopped seeing them entirely.

It's possible the dog food was not reversing the poison. Maybe with the dog food locked up they started eating more bait, or maybe it simply took longer than we expected for the poison kick in. But regardless, we definitely learned a valuable lesson about keeping the pet food well sealed!

Comment · 5 months ago
These models are getting crazy good at examining things like core dumps and disassembly. I've been using an agent to write compiler logic, and its amazing the kind results you can get by having the agent examine the raw binary outputs. I would not be surprised to see agents excel at identifying and labeling patterns for decompilation.
Comment · 5 months ago
One of the classic examples is highway traffic. You want to prevent traffic jams, so you increase the number of lanes. However, now that there are more lanes, people see less “cost” in driving, leading to even more people driving (e.g. to go on more day trips or as alternative to public transport). This can cause the traffic jams to become even worse.

So, increased efficiency can sometimes not lead to reduced latency, which goes against our natural thinking.

Comment · 5 months ago
Thanks for the correction. I did mean given the same tooling version/parameters, but (as you and others pointed out) preserving and recreating that state is not at all straightforward.

Live from the official Hacker News API

A modern reader for Hacker News · SvelteKit + Skeleton