twiss

Joined 13 years ago

Karma
1,878
Submissions
490
Member since
Jan 26
twiss.dev

airborn.io

daniel@<either of those>

[ my public key: https://keybase.io/twiss; my proof: https://keybase.io/twiss/sigs/HVKkcimzcOLJcH5jSs5ybwnbvlRO5cd0t6mIq2LhL0o ]

View on Hacker News

Recent submissions

Comment · 6 days ago
Wouldn't it be cooler if you could `return IoError{} from ^` and it would find the closest function in the call stack that can return an IoError?

Even better, you could give it some syntactic sugar like `throw IoError{}`? ;)

P.S. I think the `IoError { message, ok }` type is suspiciously close to `Result<(), String>`.. And if you want to return a value in the success case too it'll become even closer. Perhaps it's best to lean into that and find the calling function that can return an IoError as one of the possible values?

Comment · 6 days ago
> Returns across multiple calls. `return err from load` returns from a function any number of frames up, statically checked, with no unwinder, no `Result` type and no `?` on every call.

Does this mean you have to know the name of the function calling you that's supposed to handle the error? What if you're a library and don't know that?

Comment · 7 days ago

    class Order < ActiveRecord::Base
      enum :status, { pending: 0, paid: 1, shipped: 2, refunded: 3 }

      def shippable?
        paid? && !refunded?
      end
    end
Bit off-topic but if `:status` is an enum, then `paid? && !refunded?` is equivalent to `paid?`
Comment · 11 days ago
> It's worth noting that the phrase "It's fine. You'll get over it." is doing an enormous amount of emotional heavy lifting. It's not dismissive — it's pre-emptive closure. It anticipates your grief and resolves it in seven words.

AI still isn't great at counting, I suppose.

Comment · 20 days ago
https://theonion.com/about-us/ says:

> Rising from its humble beginnings as a print newspaper in 1756, The Onion now enjoys a daily readership of 4.3 trillion and has grown into the single most powerful and influential organization in human history.

so I'm pretty sure it's just a joke.

Comment · 20 days ago
I know everything they write is potentially a joke but I got curious when The Onion was founded; apparently it was in 1988, 38 years ago :)
Comment · 1 month ago
Comment · 2 months ago
Comment · 3 months ago
Support period != warranty period. The OnePlus 15 will get 4 years of Android updates and 6 years of security patches.
Comment · 4 months ago
I think this is more common when reporting heights in feet+inches than in cm. Rounding up 1.76m to 1.80m seems much weirder than rounding up 5'11" to 6', since all measurements in cm are very precise-sounding.
Comment · 6 months ago
Comment · 6 months ago
In Celcius, it's less common to round to the nearest 10 degrees (or say things like "in the twenties" as you might with Fahrenheit), because that makes a much larger difference than it does in Fahrenheit. So I wouldn't necessarily assume that "20 degrees" only has one significant digit unless it's explicitly stated. (I haven't checked the original paper, though.)

However, converting something like 21°C to 69.8°F is indeed silly and should just be 70°F.

Comment · 10 months ago
Do we know that those heavy duty trucks were formerly used to do things you need heavy duty trucks for? It seems more likely that 18% (or more!) of the usage was by people who think heavy duty trucks look cool and wanted to show off theirs.
Comment · 1 year ago
There are, in fact, some efforts going on to improve beyond the status quo on permission prompts in browsers, e.g. https://chromium.googlesource.com/chromium/src/+/refs/heads/...

Though, that document also states:

> Our research [1] finds that users often make rational decisions on the most used capabilities on the web today — notifications, geolocation, camera, and microphone. All of them have in common that there is little uncertainty about how these capabilities can be abused. In user interviews, we find that people have clear understanding of abuse potentials: notifications can be very annoying; geolocation can be used to track where one was and thus make more money off ads; and camera and microphone can be obviously used to spy on one’s life. Even though there might be even worse abuse scenarios, users aren't entirely clueless what could possibly go wrong.

[1]: https://dl.acm.org/doi/10.1145/3613904.3642252

Live from the official Hacker News API

A modern reader for Hacker News · SvelteKit + Skeleton