bajsejohannes

Joined 18 years ago

Karma
2,552
Submissions
536
Member since
Aug 20
View on Hacker News

Recent submissions

Comment · 3 months ago
If you get the ? from rust in addition to the option, then it’s suddenly a lot more convenient. It will do `if err != nil { return err; }` in a single symbol.

There’s also convenience at the returning side. You can always just return the error, and not have to care about dummy values for the other return values (which is especially annoying when changing the returned types).

That said, it might still not be worth the added complexity.

Comment · 7 months ago
To be honest, I actually agree that Dijkstra's argument seem a bit one sided. It's also interesting to see the argument in your linked article that offset and index doesn't have to be the same.

If I get the root of the argument in the linked article, it is that zero-based indexing is more of a optimization than anything, but I would disagree; there are reasons beyond that (see the examples in my previous comment).

Also, here's an example of an 1-index based system that has caused me some headaches: In music theory, the first note of the scale is called the "first", etc. It also talks about e.g. "stacking thirds", which means take the third of the scale, than take the third from there. However, the offsets are two. (first=offset 0, second=offset 1, third=offset 2). Which is hard to work with in my opinion.

You have an interesting argument about iterating backwards, although I would say; if we need a tie-breaker between the two, iterating forward should have more weight than backwards.

I appreciate your comment, and while trying as best I can to be convinced of the "other side", I still land on 0-indexing. The only argument I buy, is that it matches our natural language starting at 1. Which, of course, is a strong argument.

Comment · 7 months ago
There are arguments for why 0-based indexing is _better_, unrelated to pointer arithmetic. https://www.cs.utexas.edu/~EWD/transcriptions/EWD08xx/EWD831...

> we had better regard —after all those centuries!— zero as a most natural number

Of course, a counter argument is that we've already made the mistake of indexing with 1 in natural language (first, second, ...). That decision is not free of annoyances, though: the 19th century are year numbers 18xx, floors below the first have a varying names when they could have been negative numbers, etc.

Comment · 7 months ago
I worked on a game where we added a "fairness" factor to randomness. If you were unlucky in one battle, you were lucky in the next, and vice versa. Mathematically you ended up completely fair. (The game designer hated it, though, and it wasn't shipped like that)
Comment · 7 months ago
Interesting to see an alternative approach.

I struggled a bit to understand the explanation on github, but eventually got to something that made sense. It would have helped me if it said up front that

- 0, 1, N and Y pass the input signal on (works like a | or - in the input direction), and that - when a circuit has both a 0 and 1 output value, the output becomes 0 (which is why 11 is an AND and not a OR)

Hopefully that's correctly understood? If so, maybe consider updating the explanation for the next person.

Also, a question: Does a 0 and 1 on the same circuit consume more power than two 0s or two 1s due to the conflicting values? Or is it solved with transistors at the cost of propagation delay? Or something else?

Comment · 1 year ago
Capitalization is ignored by the compiler. So you can call it REPEAT, repeat, rEpEaT and so on. Same for variable names, functions, etc.
Comment · 1 year ago
I don't know, but anecdotally, I still use it for work, but no longer for personal chats.

It also seems like someone at Slack is tasked with driving up engagement, because I get these "Your team is missing you" messages from Slack (only to be find a dead slack community). That might be a sign that they're losing traction?

Comment · 1 year ago
Another version that's useful is this ASCII version: https://gabmus.org/posts/raspberry_pi_pico_pinout_in_your_te...

I keep a slightly modified version of it as a top comment in my main C file in every pico project. Super handy for quick reference and you can annotate it with the actual uses in your project.

Comment · 1 year ago
Thanks! I've been using pinout.xyz quite a few times; maybe you should link from there to the pico versions so it's easier to discover?
Comment · 1 year ago
Thanks! So I guess the best recourse then is to resize the table? Seems like it should be part of the analysis, even if it's low probability of it happening. I haven't read the paper, though, so no strong opinion here...

(By the way, the text fragment does works somewhat in Firefox. Not on the first load, but if load it, then focus the URL field and press enter)

Comment · 1 year ago
One thing I don't understand from watching the video, is what happens in the (very rare) case that you get collisions all the way down the funnel. I assume this is related to the "One special final level to catch a few keys" (around 14:41 in the video), but given that it has to be fixed size, this can also get full. What do you do in that case?
Comment · 1 year ago
The UX on MacOS is so bad here. First, a notification prompts you to enable Apple Intelligence. When you dismiss the notification by clicking the "x" in the corner, it instead opens the system settings and proceeds to download something (?) before showing you a checkbox where you can enable/disable it. It feels quite forced.

Live from the official Hacker News API

A modern reader for Hacker News · SvelteKit + Skeleton