HNHacker News
TopNewBestAskShowJobs

slaymaker1907

2,540 karma · joined November 22, 2016

submissionscomments
slaymaker1907··on How to Store Data on Paper?
I'd always wondered how much data you can store on paper using QR codes given that print media seems to be much better at surviving for long periods of time.
slaymaker1907··on Rhombus Language
Have you looked at idiomatic Racket code? You can freely switch between () [] and {} which makes things a lot cleaner.
slaymaker1907··on The inevitability of the borrow checker
The only thing I can think of that really matters which can’t be solved by just wrapping the data in an inner heap allocation (like std::vector) is with the pointer to the vtable for virtual function calls.

If anything, I’ve found it’s more useful when I want to bypass such wrapping to force a class to use some particular memory (like from a bulk allocation). The STL is pretty good, but there are warts that which still force the default heap allocator like std::function.

slaymaker1907··on GLP-1 for Everything
Depends on who you are and if you have an eating disorder.
slaymaker1907··on The lost language extensions of MetaWare's High C compiler (2023)
I also think that the GC of D is really a nice feature. Sometimes you want manual memory management in low level code, but there is also a ton of stuff where it doesn't really matter and a GC just makes things easier. For example, if you're writing an in-memory cache service, you really don't want the cache entries themselves to be tracked by the GC since the GC is often unaware of the actual access patterns and just gets in the way, but most of the other components of that service are better served with a GC.
slaymaker1907··on Ribbit: A portable, compact and extensible R4RS Scheme implementation
Why R4RS? Was that just the standard at the time? I know R6RS is kind of huge and difficult, but R7RS seems pretty reasonably sized.
slaymaker1907··on Apple Watch sleep apnea detection gets FDA approval
I don't use the heated hose, but the humidity is invaluable since my sinuses often end up clogged if I don't use it. However, I also live in a desert and regularly have ~20% humidity in my house.
slaymaker1907··on Apple Watch sleep apnea detection gets FDA approval
Have you tried playing around with the humidity? If I have it set too low, that definitely makes a big difference. There are also other treatments for sleep apnea that you could look into which might work better.
slaymaker1907··on Why Not Comments
I don't think doc comments are warranted in every case and definitely don't think you need to document every single parameter, return value, etc. for every single function, but they sure do come in handy for complicated APIs.
slaymaker1907··on Why Not Comments
> In recent years I see more people arguing that whys do not belong in comments either, that they can be embedded into LongFunctionNames or the names of test cases.

Who is arguing this? Usually, if I'm adding a comment on why something is done a particular way, it's something that is going to take at least a full sentence to explain if not a whole paragraph.

slaymaker1907··on Don't defer Close() on writable files (2017)
Best practice IMO would be to wrap the closable thing in a wrapper object that handles the case where Close is called multiple times and then defer close that one as well as closing at the end of the function. Another idea would be to define a small lambda that either returns the input value or returns error if Close returns an error if you want to use early returns.
slaymaker1907··on Sqlc: Compile SQL to type-safe code
You missed the ole' reliable, temp tables. I always end up using them heavily for non-trivial analytic queries since it gives you so much control over query execution.

In terms of actually using SQL more effectively, I think the ideal is just a small utility to use reflection and map a ResultSet (or equivalent) into a strongly typed object using reflection.

Even inserts can get tricky because there are so many different knobs you can tune. It's pretty rare that people just need to insert into a single table with no additional selects beforehand which means there is room to play around with preemptive locking, isolation level, etc.

slaymaker1907··on iPhone 16 Pro and iPhone 16 Pro Max
I'm by no means a professional photographer, but better zoom is definitely a big selling point.
slaymaker1907··on Chromatone – Visual Music Language
This really doesn't reflect the actual structure of Western music for those without absolute pitch (the vast majority of people). Instead, it's pretty much just relations that matter between pitches which makes things way more difficult to visualize. Mixing red and blue gives you a different color than red and green, but A-C is pretty much the same as Bb-Db, they're both minor thirds.

If you want to analyze it algorithmically, you probably need to start looking at topology or something so that you can correctly relate musical structures in a way that is resistant to transposition.

slaymaker1907··on NIH cancels ‘Havana syndrome’ research, citing unethical coercion
I’m not sure, you should look up functional neurological disorder (FND). It’s very much a real disorder, but it’s 100% causes by our subconscious brains. There are honest people who just suddenly lose the ability to walk *or even go blind*.

I’m kind of convinced that if there is a symptom, our brains can probably cause it.

slaymaker1907··on Owners of 1-Time Passcode Theft Service Plead Guilty
Talking about tooling, it’s kind of incredible how good John the Ripper is at cracking passwords. I think a lot of people would benefit tremendously from seeing how fast their “clever” tricks for coming up with passwords are demolished.
slaymaker1907··on Google's new pipe syntax in SQL
I actually work on SQL Server, but I also write a lot of KQL queries which also work this way and I totally agree that the sequential pipe stuff is easier to write. I haven't read through the whole paper, but one aspect that I really like is that I think it's easier to guide the query optimization in this sequential style.
slaymaker1907··on Many small queries are efficient in SQLite
Yes, you get some performance improvements, but I think that comes at the price of security isolation. Think about it, your application probably requires tons of libraries and evolves really quickly compared to the database itself. Additionally, having Admin/root permissions on the server hosting the DB is generally a much bigger deal than granting such permissions on an application server that talks to that DB.

If none of this makes sense, don't worry, that just means you don't work in enterprise...

slaymaker1907··on Many small queries are efficient in SQLite
Oh, I've definitely seen N+1 problems with a SQLite database before. It's more resilient than a traditional DB server, but it can still run into performance issues when doing too many select queries.
slaymaker1907··on TIL: Versions of UUID and when to use them
Yeah, if you really need non-guessability, you should be using the version that’s completely random anyways.
slaymaker1907··on Techniques for safe garbage collection in Rust
This is assuming people don’t abuse it and pass around raw references/pointers to it (they will). The safest construct, though with definite performance impact, is std::shared_ptr but people think they are smarter than they are and don’t use it.
slaymaker1907··on Adding 16 kb page size to Android
I wonder how much of a test this is for the LLM vs whatever tokenizer/preprocessing they're doing.
slaymaker1907··on MIT leaders describe the experience of not renewing Elsevier contract
I don't think it's always necessary if the paper makes it really clear how things were done. And just because the code is available, it doesn't mean that it is actually reproducible or comprehensible.
slaymaker1907··on Parsing protobuf at 2+GB/s: how I learned to love tail calls in C (2021)
A trampoline is less efficient theoretically because it implies that you must check a condition and that you can't make an unconditional tail-call. It's also not quite equivalent since it's a non-local compilation technique requiring the caller to do something differently.

It's completely different than the story with tail recursion which can be essentially reduced to syntactic sugar over a normal loop (just change the parameters to be mutable variables).

slaymaker1907··on Parsing protobuf at 2+GB/s: how I learned to love tail calls in C (2021)
It can't be rewritten as loop due to function pointers. Using JS notation to avoid noise:

function logAndCall(statement, func) { console.log(statement); return func(); }

Tail call optimization is actually possible here since we call func in "tail position". It might be unlikely to blow up the stack, but it can definitely happen if you do a lot of continuation passing.

Perhaps more commonly for C++/Rust, tail call optimization would be enormously valuable to have behind the scenes for destructors. It's actually very difficult to implement a linked list in safe Rust that doesn't explode the stack for large lists since no TCO is done for destroying subobjects. You can still avoid stack overflow, but you have to do things like manually enumerating the list.

slaymaker1907··on You've got to hide your myopia away: John Lennon's contact lenses
I posted this in another comment, but I've found sports is kind of a tossup. My current glasses are large aviators because they do a great job at keeping gnats out of my eyes that are all along my favorite trail right now. If I wasn't wearing glasses, I'd want to be wearing goggles anyway. If I want to go swimming, it's also a lot simpler with glasses since I can just take the glasses off in seconds compared to removing contact lenses.

I think this also extends to sex. With glasses, you can just take them off once you're ready and then afterwards you can just go to bed right afterwards if you want to. With contacts, you need to make sure you take them out before going to sleep.

slaymaker1907··on You've got to hide your myopia away: John Lennon's contact lenses
That's why I order mine online from Zenni. I've heard reports of some quality control before and I've had one pair come that was a bit off, but I've still saved an ridiculous amount of money as someone who loses glasses constantly. I just ordered a pair that was ~$50 and a lot of that was just expedited shipping. I made no attempt to find the cheapest frames/lenses either like a lot of the ads for normal discount glasses show. Oh, and that's WITHOUT insurance.

I have no idea why they're so expensive at most vendors. It shouldn't be cheaper for me to order glasses without insurance. That said, the cost breakdown I saw from Zenni definitely showed that the major cost was for the lenses and given that they seem to be the cheapest vendor, I suspect they're actually telling the truth. Lenses seem to be pretty complex as well to manufacture, even for simple prescriptions.

slaymaker1907··on You've got to hide your myopia away: John Lennon's contact lenses
I've tried contacts and as a counterargument, I've found that there are few scenarios where contacts work but glasses don't and that it's way more effort and expense to use contacts vs glasses. People have mentioned sports, but there are probably more sports and exercise where glasses work better than contacts like swimming (sure you need special goggles, but contacts are simply a non-starter) and cycling. I actually prefer a pair of aviator glasses for cycling because they keep things like bugs and pollen from going into my eyes even if it's too dark for sunglasses.

However, I totally agree that eye surgery is probably the best option since then you don't have the downsides of either contacts or glasses. The only reason I'm hesitant to do it is because my prescription isn't that strong and I've heard it can mess with your close up vision later in life. But for someone with severe issues, fixing the myopia and then just using reading glasses as needed is definitely a huge QoL improvement.

slaymaker1907··on Core Python developer suspended for three months
Tim literally wrote the Zen of Python and also came up with Timsort, he’s not just some random contributor.
slaymaker1907··on You've got to hide your myopia away: John Lennon's contact lenses
I think it's funny how many people really don't want to just wear glasses. I love that I can completely change my look just by getting some new glasses, though I'm admittedly fortunate to have a low rx such that I can get away without wearing them sometimes when I misplace them.

Another random comment: I just love that his contacts apparently only fit because of ptosis from using weed.

← PreviousPage 2 of 34Next →