Y
HN Search
Hacker News Search
new
|
comments
|
top
|
jobs
OskarS
searching PlanetScale…
1.
▲
2.
▲
3.
▲
4.
▲
5.
▲
6.
▲
12 ms
·
121.
▲
by
OskarS
1y ago
If the paywall bothers you, then Kagi just isn't for you, the whole point of it is to have a business model where the users are customers, not the product. I have no problem with the UI. It's snappy, clean, doesn't have a bun
122.
▲
by
OskarS
1y ago
I have a sort-of controversial opinion about this: on the contrary, this is one of the reasons I really love using a mac. As a developer, it’s super-annoying that Apple is so aggressive in deprecation stuff, it forces us to frequently spend
123.
▲
by
OskarS
1y ago
Just, as a person outside of the US: the idea that you would need an accountant at all for a private person that isn't a billionarie, is like, crazy. I have a reasonably simple personal economy and it takes me all of five minutes to fi
124.
▲
by
OskarS
1y ago
I’m assuming here that ”generator” has a decent enough constructor that seeds it properly. If it doesn’t, and you have to cycle it a few times to ”warm it up”, it’s not much more complicated, just factor out the initialization code into a f
125.
▲
by
OskarS
1y ago
Huh, TIL! I didn't realize that, I just always avoid this pattern because it's such a common source of bugs (and if I really need to, I just use the erase_if). EDIT: just saw your example and checked cppreference, it says the retu
126.
▲
by
OskarS
1y ago
Ah, ok. But then: you kinda can't do that at all. You certainly shouldn't. For unordered_map (and every hash table in the known universe) erasing anything invalidates all iterators, so you can't iterate while erasing. For std
127.
▲
by
OskarS
1y ago
I think it looks great! Might be using this in a future project. One note on API design: I think it's a FANTASTIC idea to have default `rand()` functions available, since very often, you don't really care about the generator and y
128.
▲
by
OskarS
1y ago
Both of these things are very easy to do in modern C++: // erase map.erase(2); // iterate for (auto &[k,v]: map) { // do stuff } godbolt: https://godbolt.org
129.
▲
by
OskarS
1y ago
I've read there was a huge solar flare in the 19th century that knocked out telegraph equipment all over the world. Do we know how strong that event was on that scale?
130.
▲
by
OskarS
1y ago
I got curious about this, because really the most important guarantee is in the C++ memory model, not any of the ISAs, and conforming compilers are required to fulfill them (and it's generally more restrictive than any of the platform
131.
▲
by
OskarS
1y ago
> It’s probably best euphemismed by imagining that every atomic operation is just the normal operation wrapped in a mutex Sort-of, but that's not quite right: if you imagine it as "taking a mutex on the memory", there'
132.
▲
by
OskarS
1y ago
Another thing to mention is that until very recently (Python 3.12, I think?) every interpreter in the address space shared a lot of global state, including most importantly the GIL. For my area (audio plugins) that made Python a non-starter
133.
▲
by
OskarS
1y ago
I was just having a discussion with our customer support manager for an coming update to our software. He made this point, ”I really like it when buttons have names. Then I can tell the customers ’click the EXPORT button’ instead of ’click
134.
▲
by
OskarS
1y ago
Presumably time of day matters? I’m guessing more people give birth or have c-sections during the day (not sure if that’s true of fully natural births, but for induced and c-sections, seems very likely).
135.
▲
by
OskarS
1y ago
That is a very neat trick, I agree. I personally approaches stashes as undoable "clean up", and I never have anything really important that I want to save there. If I do have something like that, I just commit with a "WIP <
136.
▲
by
OskarS
1y ago
Only experience with C# using and Python context managers, but they always seemed like such an unsatisfying solution compared to C++/Rust style RAII. I mean, I get these are GC languages, but why can't just this happen at end of y
137.
▲
by
OskarS
1y ago
That doesn't match with my understanding of free-threaded Python. The GIL is being replaced with fine-grained locking on the objects themselves, so sharing data-structures between threads is still going to work just fine. If you'r
138.
▲
by
OskarS
1y ago
> template<template<template<class> class> class C> Boy howdy!
139.
▲
by
OskarS
1y ago
> The only one that springs to mind is a View hierarchy in UI libraries. I'd like to generalize that a little bit and say: graph structures in general. A view hierarchy is essentially a tree, where each node has a bunch of common bi
140.
▲
by
OskarS
1y ago
It's actually stunning how off-putting it is. I started Duolingo because I was in a relationship with someone and wanted to learn their language. I paid for subscription because I didn't want to be assaulted with ads and upsells (
141.
▲
by
OskarS
1y ago
Meson and cmake in my experience are both MUCH faster though. It’s much less of an issue with these systems than with autotools.
142.
▲
by
OskarS
1y ago
Fair, good point.
143.
▲
by
OskarS
1y ago
Very neat visualizations! Really good way to demonstrate the underlying principles. Great article. I will add one thing: the author makes much of how problematic CPU-intensive tasks are. That's true, but also: if you need to do a CPU-i
144.
▲
by
OskarS
1y ago
But you would still need to change it everywhere, right? Like, instead of changing the annotation everywhere you have to change the type everywhere. Doesn't seem like a huge difference to me.
145.
▲
by
OskarS
2y ago
Is Guile really that good at the shell scripting "thing"? Like, the bash superpower is that it makes it extremely easy to run subprocesses in incredibly flexible ways (in the background, foreground, in pipelines, with stdout/
146.
▲
by
OskarS
2y ago
It's Knuth! [1] "Beware of bugs in the above code; I have only proved it correct, not tried it." [1]: https://www-cs-faculty.stanford.edu/~knuth/faq.html
147.
▲
by
OskarS
2y ago
For a configuration language, comments are absolutely crucial. You want to be able to say "# This option is set because <so-and-so>" to explain why you are configuring it this way to the next person that reads the code (or y
148.
▲
by
OskarS
2y ago
To be fair, you get this all the time when you run nix-channel update, "<whatever> has been deprecated/removed, use <something-else> instead".
149.
▲
by
OskarS
2y ago
> That will make the individual map operations thread-safe, but given that nobody thought of concurrency, are you sure series of operations are thread-safe? That is, are you sure the object that owns the tree-map is thread-safe. I wouldn
150.
▲
by
OskarS
2y ago
Slack is primarily a business tool, and for a business tool $10/user/month is extremely reasonable for the value (perceived or real) it brings. The company has to make money, and you do that by charging for your products and servi
More ›