HNHacker News
TopNewBestAskShowJobs

parenthephobia

618 karma · joined April 6, 2012

submissionscomments
parenthephobia··on When to Avoid JSONB in a PostgreSQL Schema
Postgres stores statistics for expression indexes, so it can know that the predicate is true for half the rows.

In the worked example, adding expression indices for the integer values of value_1, value_2, and value_3 makes the JSONB solution only marginally less efficient than the full-column solution. On my computer, ~300ms instead of ~200ms.

(This is Postgres 9.5)

parenthephobia··on How to steal a developer's local database
This problem doesn't just apply to localhost, although it's most straightfoward to exploit that way. You could also use this technique to scan the user's LAN or, in a more targeted attack, bypass IP address restrictions on specific servers.

Scripts from the public Internet shouldn't be able to access private or local networks as a matter of policy.

Similarly, in a high-security environment, scripts from a private network shouldn't be able to access the public Internet - to help prevent exfiltration of private data.

parenthephobia··on Apple’s Cook Confident of Victory in Tax Fight as Irish Dither
He said he did that in 2014, not 2011. Apple might well have paid $400 million in 2014, and that might well be 12.5% of the profit that Ireland says corporation tax is owed on.

But, there are billions of Euros of profit that, according to Ireland, no tax needs to be paid on. Being able to choose not to pay corporation tax on 99%+ of your profits isn't an option available to most companies operating in Ireland.

parenthephobia··on SRL – Simple Regex Language
I'm not absolutely sure this isn't a joke that got out-of-hand. This is the COBOL of regular expressions. :)

Whilst the conventional regular expression syntax is arguably overly compact, this is just too far in the opposite direction!

Something more PEG-like, or even Perl 6 regex-like, would make more more readable regular expressions whilst not completely throwing out everything we think things mean. Hell, even /x -- ignore whitespace and comments -- can make things much clearer:

    / ^
      [0-9a-z._%+-]+           # The local part. Mailbox/user name. Can't contain ~, amongst other valid characters.
      \@
      [0-9a-z.-]+ \. [a-z]{2,} # The domain name. We've decided a TLD can never contain a digit, apparently.
    $ /x
Tangentally, there's no point validating email addresses with anything more complicated than /@/. If people want to enter an email address that doesn't work, they can and will. If you want to be sure that the address is valid, send it an email!
parenthephobia··on Basic income doesn't emphasize divisions between poor and working people
I'm not aware of any socialist economy collapsing simply due to mass underemployment. Most socialist ex-economies collapsed primarily due to the effects of the end of the cold war. They were generally already devastated by WW2. It is by no means certain that a capitalist economy would have fared any better.

Not that it necessarily matters, since most "socialist" economies didn't really have anything like a basic income. The closest was probably the USSR, where everyone was notionally guaranteed an income, but only because everyone was guaranteed a job, and voluntary long-term joblessness was illegal.

The fact of the matter is that there has never been a country-scale attempt at implementing a basic income. Nothing even resembling a basic income has been employed in a country that didn't also have its economy devastated by war - whether civil, cold, or world. The small-scale trials of basic income have had either neutral or positive outcomes.

parenthephobia··on Zig: a system language which prioritizes optimality, safety, and readability
I'd rather use Zig than Rust because I wouldn't have to learn about how to work with Rust's memory management model. Even though I understand Rust at a technical level, actually getting my brain to work that way has proven difficult.

Being able to directly import existing C header files is also attractive.

Having said that, I'd rather Zig had been Go-inspired than Rust-inspired. Go plus Zig's approach to generics and error handling would be nearly perfect! (Notwithstanding that Zig's error handling is basically Rust's with added syntax sugar!)

parenthephobia··on Zig: a system language which prioritizes optimality, safety, and readability
But... Zig is compatible with C. It goes to some lengths to make sure of it.
parenthephobia··on Zig: a system language which prioritizes optimality, safety, and readability
Syntax looks very Rust-inspired, but it lacks Rust's OCD. I also catch hints of other syntaxes, like Ruby/Smalltalk-style block parameters, and a defer very much like go's.

I find it interesting that it implements generics by passing types as normal arguments. Say, `list(i32, 1, 2, 3)` rather than `list<i32>(1, 2, 3)`.

parenthephobia··on Discovering Planet Nine
> The classification should be based on its size, shape, and make up. Instead they classified it based on the number of objects in its orbit, which is so arbitrary and weird.

Why should it be one rather than the other? What harm or benefit comes from Pluto being called, or not being called, a planet?

> If hypothetically we cleared up the objects and dumped them in Earths orbit, Pluto would suddenly become a planet and Earth would lose its classification.

No, because the definition requires that a planet clears its own neighbourhood. Having a nearby technological civilization clean up its neighbourhood for it doesn't cut it.

> Just bite the bullet and accept there are a lot of small planets in our solar system

Dwarf planets, you might say.

parenthephobia··on Why bad scientific code beats code following “best practices” (2014)
What's the problem?

Google's initial success can be attributed to the effectiveness of the PageRank algorithm, not the quality of the code that implemented it. It doesn't matter if the first implementation (or even the current implementation) was a horrible mess of gotos in a single ten-thousand-line-long function, from the point-of-view of its users.

parenthephobia··on Why bad scientific code beats code following “best practices” (2014)
I'd love to hear about the tools which almost completely mitigate parallelism errors.

The author's list of things that are wrong with "software engineers"' code is 50% "things that are just language features" and 50% "bad ways to use language features that nobody thinks is best practice in software engineering".

Part of the irony is that lot of the more hairy software engineering techniques that he decries are used by the people writing platforms and libraries that scientist programmers use, to make it possible for their "value of everything, cost of nothing" code to actually run well.

There is a big difference in attitude between scientist programmers and software engineers.

Often, a scientist already has the solution to the problem, and is just transcribing it into a program. The program doesn't need to be easy to understand in isolation, because a scientist doesn't read programs to understand somebody else's science, she reads the published peer-reviewed paper. After all, if you wanted to understand Newtonian dynamics, you wouldn't start by reading Bullet's source, even if it's very well written. (I don't know if it is.)

Conversely, for a software engineer the program is a tool for finding the solution. Even though they're in a scientific field, if it's accurate to call them software engineers they'll be from a background where the program itself is the product, rather than the knowledge underlying the program.

parenthephobia··on Breaking a myth: Data shows you don’t actually need a co-founder
All startups are successful if you ignore the ones which fail. True, but not very interesting.

Not excluding the failures is the point of the exercise. One cannot choose to succeed, one can only choose the number of founders. The question is how many founders leads to the greatest probability of success.

Although approximately 50% of successes have one founder, it does not follow that approximately 50% of startups with one founder succeed. If 70% of startups have one founder, then those startups are under-represented amongst the winners. OTOH, if 20% of startups have two founders then, with 30% of winners having two founders, they are over-represented.

If the numbers I just made up were accurate, then it would be better to have two founders than one, even though most successful startups have one.

parenthephobia··on Breaking a myth: Data shows you don’t actually need a co-founder
A lot of people aren't interested in running a successful business except as a means to their actual goal: being independently wealthy.
parenthephobia··on Arguments against JSON-driven development
What's really being described there, I think, is the notion that you can serialize and unserialize some data and get, to some extent, the "same" data back.

Whilst that's more possible with protocol buffers or pickling (or whatever your language calls it), I can't think of any languages offhand which can round-trip any data. It's generally not possible to serialize objects denoting external resources - such as open file handles or network sockets. It's also often not possible to serialize closures, weak references (without dereferencing them), and not necessarily possible to serialize self-referencing objects: e.g. a list which contains itself - pickle can handle it, but I don't believe protocol buffers can do it.

parenthephobia··on Git Undo
I think git branch only doesn't "branch" if you already have a differing idea of what a "branch" should be from another revision control system.

For example, I consider that CSV and Subversion don't have branches, but just "copies". To my mind, what git branch does is exactly what branching is.

parenthephobia··on Git Undo
`git reset` doesn't simply remove commits. Depending upon what you reset to it could result in `git log` showing additional commits, or an entirely different set of commits. Conversely, there's no invocation of `git rm` which creates files. In this case, the commands look different because they do totally different things.

You'd have a better argument with `git rm`, `git branch -D` and `git remote remove`. :)

parenthephobia··on Arguments against JSON-driven development
What are serialization formats, then? What makes them different from notations for data structures?
parenthephobia··on Mezzano – An operating system written in Common Lisp
From what I can tell looking at the code, Mezzano doesn't have processes, just threads. There's no distinction between the kernel and user-space.

Whilst convenient, it isn't an unqualified good. Bugs in any part of the system have the potential to catastrophically break everything. It's also terrible for security. |Without the notion of a distinct kernel - or "unsafe" code that only privileged users can compile or load - there's nothing to stop user code reading or writing directly to/from IO ports or arbitrary memory locations.

Being able to pass closures isn't something that's particular to Lisp, nor does it require a lack of memory protection. It just requires that the calling convention can denote a closure as such, and can arrange for it to be invoked in the right security context - i.e. the one in which it was created.

Another issue with having a single global environment backing everything is that you can't easily experiment with changing built-in Lisp functionality without immediately crashing the system.

This sort of thing is probably perfectly fine for embedded systems, and "micro-service" VMs, though. The benefits may well outweigh the risks then. And of course it's great as a starting point for experimentation.

parenthephobia··on Signs That a Job Is Due to Be Automated
"Algorithms" don't have incentives. "Algorithms" do not seek to conserve resources. "Algorithms" do not seek to shut down purposeless activity, or indeed determine what activity is purposeless.

An algorithm might do some of those things, if the human that created it wanted that to be the case, or they didn't but the implementation was buggy.

A human writing an algorithm to run an automated medical device company would presumably include some terms which would ensure that the company's resources were used in a way that served the public good, to the extent that that was compatible with whatever other objectives that human had for the algorithm, such as making profit, or avoiding kinds of research that human considered immoral.

A human who writes an algorithm to run a company which prioritises "something" over the survival of human civilisation and resists any attempt to adjust its priorities once the error is obvious enough to be noticed, and then runs that algorithm on a system with the capability to actually cause the end of human civilization, is a super-villain or a super-idiot.

parenthephobia··on Flip Feng Shui: A new cross-VM exploitation vector
Using something like https://github.com/google/rowhammer-test

tl;dr: You check. Allocate some memory and hammer it. If you detect flips, step 1 is complete.

parenthephobia··on Why it's time to accept the fact that Brexit may never actually happen
Leave voters were unavoidably uneducated "on the ramifications of the decisions", because Leave had no post-vote plan.

The referendum wasn't a choice between two courses of action. It was a choice between carrying on as normal, and "leaving the EU", where the specifics were undefined. Nobody could educate themselves as to the ramifications, because it wasn't - and still isn't - possible to know what they would be.

Leave voters might claim they voted for restored sovereignty, or reduced immigration, or not sending the EU £350MM/week, but they didn't, because none of those things were on the ballot.

parenthephobia··on moreutils
sponge only writes the file once all input has been read, and - if the file already exists - tries to do the operation atomically by writing to a temporary file and renaming it over the old file.
parenthephobia··on Female and Male Googlers append “Lady” to their titles
> So who gets to decide that it's sexist? Anyone who feels that it is?

Yes.

Everyone gets to decide whether things are sexist, whether and when that's a problem, and whether another person having different opinions about any of that should effect the way they act towards that person.

parenthephobia··on Mistakes Beginners Make When Working with Databases
https://news.ycombinator.com/item?id=11854576
parenthephobia··on Who Needs Git When You Have ZFS?
To play devil's advocate, sometimes Git is abused to store things that aren't code, and ZFS (or similar) might actually be a better fit in those situations.

Somebody further down mentions art assets. Also potentially relevant are document repositories.

ZFS isn't very easy to use for a lay person, but that's really only a "Time Machine"-esque front-end away.

parenthephobia··on ‘Brexit’: The Vote That Could Sink Britain's Economy
I'm British and I live in the UK, and I am not like this.

I'm not a xenophobic nationalist, and I don't believe that purifying the motherland will magically fix everything.

Outside of unbalanced right-wing newspapers and their vitriolic online comments sections, polls show Remain with an, admittedly unsafe, majority. We are not all foaming at the mouth screaming at foreigners for ruining everything.

parenthephobia··on ‘Brexit’: The Vote That Could Sink Britain's Economy
People should stop using immigration to argue for brexit because it's a nonsense argument.

Leaving the EU wouldn't effect our border controls, because they aren't set by the EU.

The UK isn't part of the "Schengen Area" of countries without mutual border control. The UK has control over its border policy, despite what brexit campaigners claim. It is the UK government that chooses to implement border policies which are regarded by some as "too lax", and then, sometimes, chooses to blame the EU for it.

parenthephobia··on Google patents safety system that glues pedestrians to cars
The patent application seems dubious.

Under WIPO guidelines "the invention must be disclosed in an application in a manner sufficiently clear and complete to enable it to be replicated by a person with an ordinary level of skill in the relevant technical field."

The European Patent Office has a similar rule requiring that it can be "reproducible without undue burden".

USPTO says that "the specification must be in clear, full, concise, and exact terms to enable any person skilled in the art or science to which the invention pertains to make and use the same."

But as the article says, Google don't actually know what to make the adhesive out of. The patent defines the properties it must have, but presumably no such adhesive exists or they'd know what to make it out of. So, the patent application seems invalid to me.

The article also says "of course like many patents, the technology might never materialize," which is entirely at odds with the purpose of patents. One shouldn't, per the rules, be able to get a patent until the technology has materialized.

parenthephobia··on Chrome removes Backspace to go back
It's inconceivable that this should require any maintenance. I don't need a "backspace key goes back" checkbox, I just need to be able to customize the keyboard bindings. Decoupling the actions a program can perform from the key combinations which trigger those actions is basic stuff.

From the maintainer's point-of-view, having the option to bind "backspace" to "window.history.back" shouldn't require any more maintenance than having the option to bind "alt-left" to "window.history.back" does.

It is Google's fault that they didn't make Chrome work this way. It also means I can't unbind "ctrl-shift-q" from "quit_immediately_without_asking", because Google refuse to add an option to make it so that I can't accidentally fat-finger a C-w into something that ends my entire session. All keyboard shortcut problems disappear instantly if key bindings are configurable, however, without adding new options for each command.

parenthephobia··on Tor developer dodges FBI, leaves US
How do you know?

What verifiable evidence do you have that no NSLs have been issued demanding encryption keys, or that all such NSLs have been successfully challenged in court?

← PreviousPage 9 of 13Next →