Y
HN Search
Hacker News Search
new
|
comments
|
top
|
jobs
OskarS
searching PlanetScale…
1.
▲
2.
▲
3.
▲
4.
▲
5.
▲
6.
▲
40 ms
·
541.
▲
by
OskarS
6y ago
Yeah, that's the greedy algorithm and it will probably take you pretty far, but there's no guarantee that it's optimal. What if the package has lots of dependencies, but they are already covered by other packages. Do you kick
542.
▲
by
OskarS
6y ago
If you wanna do this bad boy for real, you depend on this one and the next 999 packages. Actually, this can become a fun optimization problem. Which 1000 packages do you depend on to cover as much of NPM as possible?
543.
▲
by
OskarS
6y ago
The lesson for me is that this particular problem is exceptionally well suited for imperative code, and makes functional code look terrible in comparison. It's not just the "Python-likes" that do well: both the C and C++ code
544.
▲
by
OskarS
6y ago
Yeah, you call tan() on that number, and suddenly your interval is like most of the number line. Actually, you don't even have to be that fancy: if the number is close to epsilon, the error bars on 1/x would be huge.
545.
▲
by
OskarS
6y ago
I mean, yeah, if you force the numbers to be floats, then of course it's going to fail. I personally think Raku's way of defaulting to floats is the better way to go for a scripting language like this, and I disagree that "it
546.
▲
by
OskarS
6y ago
Oh, missed that, it's usually 1.1 + 2.2 in these kinds of discussions. Yeah, exactly, Raku defaults to a rational number type for these kinds of numbers. I honestly think that is a perfectly fine way to do it, you're not using Rak
547.
▲
by
OskarS
6y ago
Floating point is fine. Non-integers are inherently tricky to represent, especially when you have to pack it into 32 bits. You could maybe quibble with some of the decisions around NaN and denormals and things like that, but mostly IEEE-754
548.
▲
by
OskarS
6y ago
Not in Raku it doesn't! > 1.1 + 2.2 3.3 > 1.1 + 2.2 == 3.3 True EDIT: to be clear: this is not because Raku is magic, it's because Raku defaults to a rational number type for decimal literals, which is a
549.
▲
by
OskarS
6y ago
Additionally, I think people make a hidden assumption that they don't even realize they're making: that when you ask for random numbers from numpy, they're more or less "true" random numbers, not seeded ones. Like,
550.
▲
by
OskarS
6y ago
So what is the point of it having a return value at all then?
551.
▲
by
OskarS
6y ago
I mean, yeah, at the end you only get a raw pointer, the object managing the pointer doesn't exist anymore. I'm not a Rust programmer, but I would imagine it's equivalent to the following C++ code auto ptr = std::string
552.
▲
by
OskarS
6y ago
Yes, finally! I'm no puritan, but this name is really embarrassing to use and every time you mention it to someone for the first time you have to go "no, no, no! like 'Rooster' in French!". Long overdue! It would be
553.
▲
by
OskarS
6y ago
No, you misunderstand: he mentions a common optimization where before you run your diffing algorithm, you find the common line suffix/prefix for the file, and how that will improve performance (if you have a compact 5-line diff in a 10
554.
▲
by
OskarS
6y ago
Yeah, I misread that section: he talked about how the program spent longer time in the prefix/suffix section, and how picking a better hashing algorithm would improve things, and I was going "no! don't hash at all for that pa
555.
▲
by
OskarS
6y ago
The last section is really interesting. The author presents the following algorithm as the "obvious" fast way of doing diffing: 1. Split the input into lines. 2. Hash each line to facilitate fast line equivalence testing (comparin
556.
▲
by
OskarS
6y ago
Not quite sure what example you're referring to, but you mean if you do a lambda like this? auto add = [](int x, int y) { return x + y; }; Then yes, nothing will be captured. This is a pure function lambda. It's essential
557.
▲
by
OskarS
6y ago
This does not solve the issue, if you enter a folder with RET (a slightly more obvious key than `a`), it still opens a new buffer for every directory. What you would have to do is to remap the key in dired's keymap. Which still doesn&#
558.
▲
by
OskarS
6y ago
Ugh, I find dired incredibly annoying and avoid it at all costs in Emacs. You use it once and suddenly have a gazillion buffers open, it's just the worst! They don't even go away when you deliberately close them with q!
559.
▲
by
OskarS
6y ago
That is... quite the issue thread. So many people to be annoyed at in there!
560.
▲
by
OskarS
6y ago
> I loved GEB when I first read it in high school, and when I first reread it years later, but I don’t think its fundamental view of the relation between minds and machines has stood the test of time. I still see this as an open question
561.
▲
by
OskarS
6y ago
I’m actually really curious about this! It was built in the mid 19th century, was there excavators then? Or was it shovels and manpower? I looked on wikipedia hoping to find some info, but was sadly disappointed. I would TOTALLY read an in
562.
▲
by
OskarS
6y ago
Also: as a Swede, I must say, it works very well. It is also a closed source thing, but unlike this Stockholm Stad system, it’s basically a success story from the end user perspective. It’s great to have a unified, secure and easy to use wa
563.
▲
by
OskarS
6y ago
It’s usually not the right call to use a hash table like you’re describing. You’re not saving any work (all keys have to be migrated sooner or later) and by doing it like this you incur a non-trivial amount of overhead on most operations. H
564.
▲
by
OskarS
6y ago
I agree that that stat is unsettling, but I really can’t judge the people making this choice. It’s an impossibly hard situation to be put in, and you can’t be judgmental. Decisions like these are never easy, and never taken lightly by anyon
565.
▲
by
OskarS
6y ago
The social features were actually killed off before the product itself: a few years earlier they did a redesign which removed all of the social features. The social features were cool, I remember following a couple of journalists i really l
566.
▲
by
OskarS
6y ago
Why is that ironic? The obvious use case for a computer is to, you know, compute things, and the most obvious way to do that is to use a program designed for that very purpose.
567.
▲
by
OskarS
6y ago
https://xkcd.com/1172/
568.
▲
by
OskarS
6y ago
I agree! The protocol is not particularly interesting information, as long as it indicates secure vs. non-secure connection somehow. As long as it comes along when you copy the URL, it's fine. The bad version of this trend is when you
569.
▲
by
OskarS
6y ago
What are you even saying? Are you implying that HTTPS is a bad thing because of... SEO? The Play Store? AMP? What is your point exactly?
570.
▲
by
OskarS
6y ago
What are you talking about? Julia is dynamically typed and Rust doesn't support function overloading. It's hard to imagine two worse languages to compare to C++ in response to that comment.
More ›