Recent submissions

Comment · 1 year ago
That could be habit if she got used to one side rather than brain asymetry
Comment · 1 year ago
I thought this would work:

#define C(x) (sizeof(char[x]), x)

sizeof is a compile-time operation so x need to be known at compile time.

It didn't work as expected. It turns out there is an exception and the standard says that sizeof is actually calculated at runtime specifically for variable length arrays:

> The sizeof operator yields the size (in bytes) of its operand, which may be an expression or the parenthesized name of a type. The size is determined from the type of the operand. The result is an integer. If the type of the operand is a variable length array type, the operand is evaluated; otherwise, the operand is not evaluated and the result is an integer constant.

Comment · 2 years ago
He's not the boss anymore at this point (2003). Ballmer took over as CEO in 2000.
Comment · 2 years ago
It is if the object can't be meaningfully cast to the type. I'd expect to get an exception. That's why they exist.

For example, consider explicitly casting the string "abc" to an int. Python throws a ValueError. Ruby silently ignores the problem and gives 0. I consider the Ruby behavior to be a gotcha.

Comment · 2 years ago
I'm selecting 70B and it is coming back with "Answer | Phind-34B Model".

I'm not sure if it's really using the 34B model or if the UI is wrong about which one it used

Comment · 2 years ago
The other NYC bridges are all (I think?) named Bridge, but they went with Crossing here because Outerbridge Bridge sounds weird.

Another NYC one: A lot of people think "major" in The Major Deegan Expressway means it is a significant expressway, but actually the expressway is named after (Army) Major William Deegan

Comment · 2 years ago
Why can't you search them? In the android app at least, I've never had a problem with search working properly
Comment · 2 years ago
Comment · 2 years ago
Comment · 3 years ago
The usual justification for having a concept of "undefined behavior" at all is specifically to allow compilers to "rule out this possibility" so they can make this sort of optimization.
Comment · 3 years ago
Materialized views handle this scenario, but sqlite doesn't have them
Comment · 3 years ago
log.exception is also usually bad when you are re-raising the exception. That often results in same stacktrace logged multiple times in a row which can be confusing or at least annoyingly verbose.

But it can be helpful to log an error message (without stacktrace) to give context that is available only in this frame before letting the exception propagate to whoever ultimately handles and logs it.

Comment · 3 years ago
Walking past an eatery with outdoor seating, I overheard one diner say the phrase "process raw logs" and I thought, "wow, I guess that is one of those tricky problems that basically everyone ends up dealing with".

And then I heard "... with a chainsaw. It's a chainsaw mill" and realized I may have misunderstood the context.

Comment · 3 years ago
Is this similar to std::optional? It's a box containing a value. Copying the optional copies the value.

Live from the official Hacker News API

A modern reader for Hacker News · SvelteKit + Skeleton