HNHacker News
TopNewBestAskShowJobs

dnr

748 karma · joined April 24, 2012

email: davidn@gmail.com
submissionscomments
dnr··on Go generics draft design: building a hashtable
`2.days.ago` is not "cool," it's an example of the some of the worst things about Ruby. Suppose I came across a cutesy expression like that in a program I was reading. How in the world am I supposed to figure out what code is invoked by that expression and where that code lives?

It's emphasizing writeability over understandability, which is totally backwards from the point of view of engineering robust systems.

Except it's barely even writeability, it's some bizarre notion that code should read like English where possible. And of course, since it's not actually English, it's only possible in limited ways and trying to generalize past those limits will break. So you have to learn exactly where the limits are anyway, which is as much effort as learning to use a proper library, except harder because a proper library will have the decency to stay in its own namespace.

dnr··on Is Dark Mode Such a Good Idea?
I really just don't understand this pushback. I posted a comment about eye strain. I've been using computers for almost 30 years. Do you really think I haven't tried turning down the brightness? Is it that hard to believe that there are people out there that sincerely, legitimately, prefer light-on-dark text (possibly due to physiological differences in the eyes or brain)? Why this need to "correct" people? Just let people do what works for them!

(If you meant your comment to be "I found this works for me: ..." or "Have you tried ...?", then write it that way. The imperative mood is off-putting.)

FWIW: On my laptop, which I use most of the time these days, I adjust the brightness continually, probably 20+ times a day, and keep it pretty low. (I buy Thinkpads partly because their minimum brightness is so low.) On my desktop monitor, which is more annoying to adjust, I actually keep it at 0 most of the time, and bump it to 35 when the sun is out.

dnr··on Is Dark Mode Such a Good Idea?
These articles are so bizarre to me: he's writing about dark mode and light mode as if you can just... _choose_ one or the other and be roughly equally happy either way? I would never even think to look at "studies" when it's blindingly obvious: light mode makes my eyes hurt a lot, dark mode is very comfortable.

The only time I can even consider using light mode is mid-day with plenty of natural light around. At night when all the lights are dim, even the lowest brightness on my laptop (which is quite low), plus redshift, plus blue-blocking glasses, isn't enough to be comfortable in light mode. I use the "Deluminate" extension for Chrome to make all sites dark, all the time.

Perhaps I'm unusually sensitive to light (I think I am), but based on the comments here I think I'm far from alone.

dnr··on Western Digital’s SMR disks won’t work for ZFS, but they’re okay for most NASes
The drive firmware and layout are more sophisticated than you're imagining: All SMR drives have some non-SMR (CMR) zones for buffering and metadata. For the archival drives I was looking at a while ago (host-managed), it was usually 1% or 0.5% of the total. I would imagine these stealth-drive-managed ones have even more, maybe a few percent, to allow more buffering and hide the cost of shuffling data.
dnr··on The 5.7 kernel is out
Just a quick followup: I installed 5.7 (still on Ubuntu 19.10) and no hangs yet.

I got a bunch of warnings about missing firmware so I manually downloaded some i915 firmware files from the linux-firmware repo. I assume that's just an Ubuntu packaging quirk. I'm not sure if they were actually needed or not.

dnr··on The 5.7 kernel is out
Btrfs actually has a simpler interface than ZFS: it consumes block devices and exposes only a filesystem, not more block devices. It does have integrated volume management functionality, but overall acts much more like a "regular" filesystem than ZFS.
dnr··on The 5.7 kernel is out
Thanks for the overview. I know HN isn't the place for this but just for the record: there are no other i915 messages in dmesg (certainly nothing about a file with debug info).

This is on Ubuntu 19.10, kernel 5.3.0, and it started happening after a minor update, so I figured it would probably get fixed in another minor update. That didn't happen, so then I thought I'd better update to a newer kernel before reporting anything. Then 20.04 was almost here, so I decided to wait for that. Hopefully I'll get around to that soon and discover my particular bug has been fixed, otherwise I'll try to report it.

dnr··on The 5.7 kernel is out
Will this fix my "i915 0000:00:02.0: Resetting rcs0 for hang on rcs0" that's makes my screen freeze for 5 seconds multiple times a day??? It's been driving me slightly crazy.
dnr··on GE switches off light bulb business after almost 130 years
If you look at reviews of Z-Wave dimmers and switches, as I did recently, GE seems to be not very well regarded, and on the expensive side. Some of the newer brands like Zooz and Inovelli have a lot more features and are cheaper too. I narrowed it down to those two and then recently replaced a bunch of switches with Zooz products. Happy so far. (Can't speak for zigbee.)
dnr··on Subspace – A simple WireGuard VPN server GUI
Yup! I had many (many) hours of fun, and got pretty deeply into the development community that sprung up after the publisher abandoned it. I learned a lot from that and it definitely had an effect on my career.
dnr··on Ask HN: Dark mode for HN please?
Use Deluminate for dark mode on all sites!

https://chrome.google.com/webstore/detail/deluminate/iebboop...

I tried most of the "dark mode" chrome extensions out there and found this was the best (compatibility, performance, etc.). Not affiliated, just a happy user.

dnr··on Ask HN: What's your quarantine side project?
Finally got time and motivation to continue working on my collaborative crossword puzzle app:

https://squares.io/

dnr··on OFFSystem
Just a clarification on 4'33": recordings of it are not pure silence (and are not intended to be). They're recordings of actual musicians on an actual stage, not playing any music. So you hear lots of little environment sounds, movements, coughs, etc. It seems plausible for a particular recording of that piece to be copyrighted. Or for the instructions to be.

The issue in that link is weird because it seems like part of the problem is that he credited Cage on his own album, admitting that he was copying it.

dnr··on Apple changes default MacBook charging behavior to improve battery health
For Thinkpads running Linux, you can do this (somewhat manually) with tpacpi-bat:

https://github.com/teleshoes/tpacpi-bat

I set mine to stop charging at 85% and not start again until it drops below 75%. If I know I'm going to be away from power for a while (e.g. traveling) I manually tell it to charge up to 95%.

Anyone know if there's something like that for Android?

dnr··on Renaming files with mv without typing the name two times
Here's my contribution to this useful class of scripts:

http://dnr.im/tech/articles/mvdir/

https://bitbucket.org/davidn/mvdir/src/default/mvdir

Similar to vidir, but predates it by a few years. I still use it regularly!

dnr··on YouTube accidentally permanently terminated my account
https://github.com/gilesknap/gphotos-sync

I run it nightly from my home server. It has a few limitations (due to limitations of the Google Photos API) but overall it does what you want.

dnr··on Ask HN: What are you learning?
Tensorflow (v2), numpy, and related stuff for image processing. I kind of ignored the whole deep learning revolution, though I had a very basic understanding of NNs from a long time ago. It's fun to play with, and I'm getting an intuition for what sorts of problems NNs are likely to help with.
dnr··on Ask HN: Great fiction books that have had a positive impact on your life?
He only has two collections published so far. I thought the first one (Stories of Your Life and Others) was slightly better than the second (Exhalation), but both are good.
dnr··on MessagePack: like JSON, but fast and small
Take a look at FlexBuffers, part of FlatBuffers. FlatBuffers itself is similar to CapnProto and requires a schema, but FlexBuffers is a related schema-less format that uses a bunch of the encoding techniques from FlatBuffers to gain advantages like (I believe) not having to parse unneeded substructures.
dnr··on Downsides of Google Authenticator
Right, so ideally I would like to keep something in a safe deposit box (or similar), but the point is I don't want to keep going back and forth to the bank every time I sign up for a new account with 2fa. That's why I want one long-lived secret that I can put there, and have the TOTP secrets encrypted with that one.
dnr··on Downsides of Google Authenticator
I definitely want to keep 2fa secrets on a phone, not my laptop, otherwise it's not a true second factor. If you have an Android build to try, I'll check it out.

Also, part of my ideal requirements is an app built by an entity that I trust as much as Google. Open source is great, and this app is simple enough that I can skim the code once, but I'm not going to do it for every update, and I might miss something. There's still something to be said for that kind of accumulated trust. (I might not trust Google as much as I used to, but I still keep my life on gmail, so I have to trust them pretty far.)

dnr··on I Want Off Mr. Golang's Wild Ride
I think you might be reading an unintended meaning into that sentence. I'm talking about the experience of using Go vs. what people write about it, not about your experiences with other languages (which I have no intention of invalidating). I was pointing out that sometimes one can get a skewed perspective of the typical experience by reading blog posts and things (which by definition are written by the more vocal members of a community).

I did use Go professionally for about five years, and read lots of criticisms of it (and still do out of curiosity). Most of them struck me as just not a big deal in practice. When I had to write some list-processing code that could be greatly simplified with generics (a few times per year), I just sighed and typed it out and moved on to a more interesting thing. When I had some repetitive error-handling code, I refactored it or wrote some helper functions. The dependency stuff was annoying when starting a new project, but once you pick a dependency manager/vendoring tool it's fairly straightforward (and of course now this is included).

Certainly, the language and ecosystem has warts and frustrating things. Maybe Elixir has fewer warts, I don't know. But overall the experience of using Go is fairly smooth and boring and productive. The things that people like to complain about don't really register in day-to-day usage. That's not BS, that's my personal experience.

dnr··on Downsides of Google Authenticator
I've used Google Authenticator for a long time, but the lack of backups is a really serious downside. What I would really like is encrypted backups using a strong passphrase that I can write down on paper (like Authy), but from a trusted source like Google, and with no other features to widen the attack surface (no internet access, no SMS).

Without backups, having a phone die or get lost is a very frustrating experience. If you use backup codes, you have to go re-register 2FA on every account with backup codes. And of course some don't offer backup codes.

You could screenshot and print out the QR code at registration time (I've done this for a few accounts), but shared printers apparently retain history of everything they've printed, so you'd need to own a personal printer, which seems absurd.

You could write down the TOTP secret on paper instead. Ideally with multiple copies and then move them to different physical locations. That's a big hassle to do for each new account registration, which seems to happen every few months.

Encrypted backups solve this easily: you get one key, which you write down once and distribute to different locations if you want. After that there's nothing new to do for new accounts at registration time. And restoring onto a new phone after one dies is also easy.

dnr··on I Want Off Mr. Golang's Wild Ride
If you were using Go for those four years, you'd also see very little of the criticisms regularly leveled at Go. What you see on the internet is the union of everyone's complaints and frustrations. Each individual sees only some of those, maybe even none depending on the type of work they're doing. And the ones that are generally happy don't tend to post big rants, so the overall impression of an outsider can be pretty skewed.
dnr··on Reddit’s profane, greedy traders are shaking up the stock market
No, please do _not_ drop a double opt-in on this or any situation where you're collecting email addresses. People mistype email addresses all the time. Always verify email addresses before using them.

(This is a personal pet peeve since I have a short email address that tons of people sometimes think belongs to them, and get a huge amount of mail intended for other people.)

dnr··on The Next Leap in Self-Driving: Prediction
That's why I added the qualifier "generally". When there's little or no intersecting traffic and no ambiguity about right of way, it seems perfectly safe to me to slow down but not completely stop at stop signs (i.e. the "Idaho Stop"). But I admit it's technically not legal where I am. Of course, most cars don't come to a full stop at stop signs in those situations either.
dnr··on The Next Leap in Self-Driving: Prediction
Ha. I do this too: as a cyclist who generally follows traffic laws and vehicular cycling behavior, I get annoyed when cars that obviously have the right of way at an intersection want to wait for me to go through first. So, I just stare at the ground and don't move until they do.

I know they're trying to be nice, but it ends up slowing everyone down: suppose a car and a bike are approaching a four-way-stop intersection with the car clearly going to arrive a couple seconds before the bike. As the cyclist, I would assume the car will come to a stop or almost-stop, wait about a half or one second, then start moving. With that assumption in mind, I'll adjust my speed so that I slow down for the stop sign (prepared to stop in an emergency) and roll through right behind the predicted position of the car, without losing too much momentum.

If the car takes their right of way, this is great. But suppose they decide to stop completely and wait for the bike to go through first (against the right of way). Now as the cyclist, I also have to stop completely, since I don't know when they're going to start moving again. If we make eye contact, I'd feel safe to go, but I feel like that's reinforcing bad behavior. Instead I refuse to make eye contact and force them to go first, as they should have initially.

dnr··on Signal is finally bringing its secure messaging to the masses
You need a phone to create an account and register the desktop app but then you can then use it completely separately from the phone, even when the phone is not online. You can link multiple desktop apps to one account/phone (afaik).
dnr··on Streets with Nooks and Crannies Are Beloved and Endangered
Downtown, like below 14th st, feels a lot more like that, and even more the further south (i.e. older) you go. Midtown and uptown not so much.
dnr··on On-disk format robustness requirements for new filesystems
Just more anecdotes: I accidentally filled up a 2tb btrfs filesystem on ssd with a buggy backup script. I deleted the stuff that shouldn't be there, ran a few recommended incantations, and was back to normal in about ten minutes. It was much less of a big deal than I expected based on what I'd read.
← PreviousPage 3 of 11Next →