HNHacker News
TopNewBestAskShowJobs

bajsejohannes

2,552 karma · joined August 20, 2008

submissionscomments
bajsejohannes··on Go 1.27 Interactive Tour
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.

bajsejohannes··on LÖVE: 2D Game Framework for Lua
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.

bajsejohannes··on LÖVE: 2D Game Framework for Lua
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.

bajsejohannes··on LÖVE: 2D Game Framework for Lua
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)
bajsejohannes··on Aegis – open-source FPGA silicon
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?

bajsejohannes··on Learn Turbo Pascal – a video series originally released on VHS
Capitalization is ignored by the compiler. So you can call it REPEAT, repeat, rEpEaT and so on. Same for variable names, functions, etc.
bajsejohannes··on Slack's 57MB 404 page
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?

bajsejohannes··on Show HN: Interactive pinout for the Raspberry Pi Pico 2
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.

bajsejohannes··on Show HN: Interactive pinout for the Raspberry Pi Pico 2
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?
bajsejohannes··on Undergraduate shows that searches within hash tables can be much faster
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)

bajsejohannes··on Undergraduate shows that searches within hash tables can be much faster
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?
bajsejohannes··on How to turn off Apple Intelligence
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.
bajsejohannes··on Understanding the Odin Programming Language
I agree with OP that it's unnecessarily confusing. A "method" is a procedure. The floating point number is the result of that procedure, not the procedure itself.

"Decimal" implies a ten based system, even though it's perfectly fine to say "binary decimal".

Using your own replacement words, it would be clearer to write "A floating point number is a representation of a number with a fractional part".

bajsejohannes··on A live ranking of airlines by how much luggage they are losing
How much of luggage handling is the airline vs. the airport crew? I had assumed it was mostly the latter.
bajsejohannes··on That Editor
> admittedly in spurts

I haven't watched his videos, but this seems like a sign of quality. Making a video when you have a great idea vs making a video a week or day just to feed the algorithm.

bajsejohannes··on A secure embedded operating system for microcontrollers
There's also MPU in even simpler/cheaper MCUs. For instance, ARM Cortex M0+ sports an MPU, and this architecture is used in STM32C0 ($0.24 in bulk) and RP2040.

I have no idea how the landscape looks in general, though.

bajsejohannes··on Why scientists say we need to send clocks to the moon
This is because of relativity and the fact that there's more force at in the valley than the mountain.

https://en.wikipedia.org/wiki/Time_dilation

bajsejohannes··on Sorry, iPads
I also have mixed results with using the iPad as an external monitor. It works every time, but it's orders of magnitude more fiddly than an actual monitor.

Exposing it as a monitor sounds like a much nicer interface, although I don't think Apple wants that, since it wouldn't work wirelessly.

bajsejohannes··on The push to ban ransom payments is gaining momentum
And just to spell it out: Fewer payout means fewer resources to spend on further operations. So I would absolutely think that the criminals care if there is an actual ban.
bajsejohannes··on FuryGpu – Custom PCIe FPGA GPU
The up an coming GateMate seems interesting to me. They are leaning heavily on open source tooling.

chip: https://colognechip.com/programmable-logic/gatemate/ board: https://www.olimex.com/Products/FPGA/GateMate/GateMateA1-EVB...

bajsejohannes··on Create a shortcut for even lower phone brightness
https://lunar.fyi/ can do that (as well as control brigthness on external monitors)
bajsejohannes··on Origins of the 3.5in Floppy Disk [video]
I never knew these were actually 90mm, and not actually 3.5in. Surprising, since I'm in a metric country.
bajsejohannes··on What every software developer must know about Unicode in 2023
I just not sure why they put in the "Angstrom symbol" to begin with. If you do, then why isn't the "meter symbol" (m) also represented?

Fortunately, it seems like it's marked as deprecated: https://en.wikipedia.org/wiki/Angstrom#Symbol

bajsejohannes··on What every software developer must know about Unicode in 2023
It goes 90000..9FFFF then 100000..10FFFF. The latter should have been A0000..AFFFF.

So the author is using hex for the last four digits and decimal for the remaining ones.

bajsejohannes··on Goodbye integers, hello UUIDv7
The preference is purely about the amount of characters. I hope no one will ever actually read or write these URLs, but you never know...
bajsejohannes··on Goodbye integers, hello UUIDv7
Because a hash is (by definition) a one-way function. You need to be able to go the other way for incoming ids.
bajsejohannes··on Goodbye integers, hello UUIDv7
I'm actually working on encrypting database keys like this, and I opted for a string ID with "url safe" base64. It avoids the ambiguity of looking like a UUID when it's not, and I prefer "o3Ru98R3Qw-_x2MdiEEdSQ" in a URL over "a3746ef7-c477-430f-bfc7-631d88411d49". (Not that either one is very beautiful)
bajsejohannes··on Goodbye integers, hello UUIDv7
You would still use a secret key, so it's impossible for the end user to decrypt it.
bajsejohannes··on Flexbox Froggy
Games seem to be a great way to learn CSS. I'm guessing because it has very natural learning path were you can solve increasingly hard problems that all seem easy because of what you've already learned.

I enjoyed this game to learn CSS selectors a while ago: https://flukeout.github.io/

bajsejohannes··on Ray-Ban Meta Smart Glasses
> Designed for living in the moment

> Capture life's best moments and live-stream to Instagram and Facebook. Now with a 12 MP camera and 5-mic system. Stay connected with hands-free calls and messages and listen to your favourite tracks through built-in speakers.

I have a very different idea of what "living in the moment" means.

Page 1 of 17Next →