Recent submissions

Comment · 2 years ago
It's loading untrusted python different from loading untrusted dll/so? Unless your use some dedicated sandbox, I think they're equally insecure. I guess a bigger problem with native plugins is that they're not (usually) platform independent.
Comment · 2 years ago
I don't understand the question about empty values. A row with there empty values is just:

,,

And yeah, dealing with separators is annoying, but pretty much every reader supports quoted values and escapes (not every writer cares up add them, though).

In practice I use csv to process large amount of tabular data (like logs, events, etc) where I care about greppability and performance more than about potential for 0.001% of corrupted data. YMMV of course, if getting it 100% right is important use something else (JSON is not without sins too, consider that JSON numbers are often parsed as floats).

Comment · 2 years ago
Also, in general, people are quick to insult others online. Somehow it's easier to degrade someone online than I'm person, and there's less incentive to look for the common ground.

That also can't be healthy.

Comment · 2 years ago
Just like in 1939, ...wait. Maybe blaming social media for fascism is a step too far.

But I'm interested to hear what you have to say about that. Why did social media enable fascism now, and why did fascism exist before it?

Comment · 2 years ago
I think you're confused about the difference between [x]*4 and [x for _ in range (4)]. It's not, at any point, a difference between something being a value or reference.

The first code is equivalent to:

list_multiply([x], 4)

(the function is actually called list.__mul__, but that's an unimportant detail). The latter is a syntax sugar for:

out = [] for _ in range(4): out.append(x)

(actually a bit more complex, but close enough).

When you understand it, the behavior is obvious in both cases.

Comment · 2 years ago
>That's the complaint, that [[]]*4 is not shorthand for list comprehensions and that it's something entirely different.

Well, of course. It's a shorthand for duplicating the list elements four times. In this case, the list contains a single reference to an empty list, do the result contains four references to an empty list.

Comment · 2 years ago
It's syntax sugar. I use it all the time, but of course it could always be respected by, i don't know, a for loop. It also makes writing duck typed code easier, as X3 will work for strings, bytes and lists.

Overall it's a very useful feature and I don't think it's that surprising. It's pretty obvious [x]4 will reuse the same reference. Just like manually adding "x" four times will.

Comment · 2 years ago
Comment · 2 years ago
Musicians put their music on Spotify out of their own will. If they don't like it they can withdraw. Unless they sold the rights to a music label, but that's also their decision.
Comment · 2 years ago
Can you explain your idea? Your algorithm is correct by definition, but doing this naively would be very slow (even for 32bit number). At this point it would be much faster to just binsearch it.
Comment · 2 years ago
The common joke/fact in the nix community is the nix "triad": nix the language, nix the operating system, and nix the package manager. Sometimes it gets confusing, but usually context is enough.
Comment · 2 years ago
Agreed. I've tried to write a json-nix converter (because I wanted to try configuring my system in jsonnet) and it's absolutely not easy, or obvious how to do this.
Comment · 2 years ago
As a NixOs lover and user, nix-the-language is my least loved feature of the ecosystem. But at a user is not a big problem because I only write configurations for myself, and it's not like my OS configuration is a proper program, it's closer to data.

One upside is that because it's hard to write complex programs in nix, people don't do it (unless really needed). So the nixos tutorials and configuration examples on the internet are usually pretty simple. This is good for beginners, and nixos is already a huge undertaking.

With lisp I'm sure many of us would get crazy with abstractions.

Comment · 2 years ago
I never got the hate for Makefiles. Granted I mostly use them for simple projects, but compiling C project takes just a few lines of code (compile .c to .o, .o to executable, optionally provide some PHONY convenience utils) and is very readable and hackable. What's not to love?

I'm sure I'm missing something, and it's possible that they don't scale well, but I prefer it to any other could system for small C projects.

Comment · 2 years ago
Well it's used by both because it's pretty useful in attack-like situations.

Live from the official Hacker News API

A modern reader for Hacker News · SvelteKit + Skeleton