HNHacker News
TopNewBestAskShowJobs

zeroimpl

621 karma · joined January 11, 2018

submissionscomments
zeroimpl··on Google fined €100M by Italian antitrust over Google Play abuse of dominance
Definitely agree here. I’ve never associated a physical ruler with the verb rule.
zeroimpl··on Can I Email?
You could also do that even better with plain <img> tags, so that's not really a special attack vector.
zeroimpl··on The Time Everyone “Corrected” the World’s Smartest Woman (2015)
The other door is not irrelevant.

When you first picked a door, there was a 33% chance it was right, and a 67% chance one of the other two doors was right.

Once the other door got opened, it is still a 67% chance that the other two doors is right, but you now know which one of those two it would be - the one which wasn’t opened.

zeroimpl··on Uncomputable Numbers
There’s an important difference between Turing machines and computers: unlimited memory. For a computer with limited memory, of course you can determine whether a program halts, because if it doesn’t halt then eventually the state machine must loop back to a prior state.

I find this answer on quora to the question of why Turing machines are a good model to be insightful: https://qr.ae/pGGCmq

zeroimpl··on Against Alcohol
I’m similar - rarely drink and dislike most alcoholic drinks - except that I have found certain flavors I like. Usually it’s sweetened wines, or cider. Also it’s often about pairing - the acidity or tartness sometimes just hits the spot.

Good things to compare to are:

- spicy food

- stinky foods (eg cheese)

- coffee

All of the above are acquired tastes. I could barely eat spicy before, now I love it. Stinky cheese makes we want to vomit, but others enjoy it. I only drink decaf, yet periodically enjoy a black coffee, something which seemed absurd when I was younger.

To me alcohol is just one more flavor option. I wouldn’t want it banned just because other people can’t control themselves.

zeroimpl··on TUI 737 weight incident traced to ‘Miss’ interpretation of female passengers
So what do they do for men? Is there something other than "Mr" which is routinely used to identify male children?
zeroimpl··on Background: how we got the generics we have (2020)
Fun fact - if you don’t like Java erasing types by default, you can just pass them along manually yourself.

There’s a bunch of ways to do this, but I’ll just leave this one trick here.

Instead of:

    List<Integer> x = new ArrayList<Integer>();
write this:

    List<Integer> x = new ArrayList<Integer>(){};
Now you’ll be able to ask at runtime and determine it is a subclass of List<Integer>.
zeroimpl··on Background: how we got the generics we have (2020)
I’d just solve this by passing in a Class<S extends Iterable<R>> arg and making the returned list be an instance of this class, instead of forcing the input collection type to be the same as the output collection type.
zeroimpl··on Some opinionated thoughts on SQL databases
The note that savepoints in postgresql don’t perform well is news to me. They are used extensively in different applications. Even in plpgsql, any time you catch an exception, it’s using savepoints under the hood. Perhaps there is room for more optimization there.
zeroimpl··on Speeding up SQL queries by orders of magnitude using UNION
I suspect query #2 would have performed better if they used a COALESCE instead of an OR condition. One of the most important optimization lessons you can learn is not to use OR for any join conditions.

Eg instead of this:

    ON (customer_order_items.meal_item_id = meal_items.id
        OR employee_markouts.meal_item_id = meal_items.id
       )
Do this:

    ON meal_items.id = COALESCE( employee_markouts.meal_item_id, customer_order_items.meal_item_id )
The latter can optimize properly. Probably still slower than the UNION, but would be more in line with expected performance. It might be more useful too in certain cases, such as if building a view.
zeroimpl··on Speeding up SQL queries by orders of magnitude using UNION
Umm.. virtually no join on tables with more than a handful of rows is done as a cartesian product. A suitable set of columns is used to sort or hash each side of the join, such that the actual join logic is basically linear performance (each row in table A is probably only ever paired with approximately 1 row in table B when evaluating the predicates). A cartesian product would involve testing the predicates on every combination of A and B (each row in table A being paired with each row in table B)

(Note when I say linear performance, I mean the join predicate is executed a linear amount of times, but the initial sort/hash operation was probably more like O(n log n))

zeroimpl··on GitHub, fuck your name change
On the other hand, now that the name change is done, if there are more protests then nobody will waste time talking about whether Github should change the branch name. This time, people were talking about it even before Github did anything, so it was going to be a distraction regardless. Github doing this ought to be considered just closing the book on this discussion IMO.
zeroimpl··on GitHub, fuck your name change
The irony here is two much
zeroimpl··on Mac upgrade opened sshd to brute force password attacks
> For a good number of years, I've been (foolishly, as it turns out) using the included Apache httpd to run small localhost-only stuff on my Mac laptop. In recent times, I found that every upgrade of the OS would revert my httpd.conf and it would need to be put back.

I did this too until very recently as well. Finally got around to just setting up a docker image serving data from ~/Sites. I think it was the switch to an unexpected php version which convinced me.

I've just taken a look through /etc/ for anything else I may have configured which got lost. Doesn't seem much I touched myself, but seeing lots of files like /etc/shells~orig and /etc/syslog.conf~previous which are odd.

zeroimpl··on America is not made for people who pee
Shouldn’t the title of the submission match the title of the article? Anatomically correct suggests something very different.
zeroimpl··on You can't parse [X]HTML with regex (2009)
This answer is right. The original question isn't asking anything about parsing, they are trying to search for specific tags, which is a great use for a regex. Yes, it will probably return some invalid matches unless you go out of your way to filter out comments and script tags, but odds are you don't need that.

Applying regex's only really count as "parsing" when you are matching against an entire document. Searching is not parsing. Same argument applies if you apply grep to an html doc - I wonder why there's no posts about "you can't parse HTML with grep". I apply grep all the time to source code...

zeroimpl··on The CNAME of the Game: Large-scale Analysis of DNS-based Tracking Evasion
The ad company isn't going to trust any data which is routed through the backend of your web server. Otherwise spoofing page views/clicks is trivial.

The next step is to get a CDN to proxy both www.example.com and tracker.example.com and promise to be independent, or for the ad company to operate the proxy themselves.

zeroimpl··on BigInt is finally here in ES2020
I’m sure they could make stringify work, since numbers in JSON can be arbitrarily large. But parsing JSON and having it return BigInt instead of Number just isn’t going to be able to work by default. I guess because of this, making stringify work without parse support just isn’t desirable.
zeroimpl··on Apple removes $1k featureless iPhone application (2008)
The seller of the app knows practically nothing about the buyer, basically just the IP address when they launch the app, and other vague details.
zeroimpl··on Global Associative Arrays in PostgreSQL
That was option #3:

    Store this object in a table and load it in the function.
    
    Storing it in a Table and accessing the elements by selecting from the Table. This can be a heavy overhead.
While I can’t don’t know for sure how much overhead that is versus launching into tcl, I do avoid creating temporary tables in performance-sensitive code.
zeroimpl··on The Pretty JSON Revolution
Perhaps the purpose is to list colors in a specific order, such as to show to the user in a desired order?

And before you argue that dictionaries can still be iterated in order, you better check the sibling threads where people are arguing you shouldn’t rely on that.

zeroimpl··on JSON with Commas and Comments
It is a minefield, but we all walk it all the time.

A new mime type doesn’t really help because the parser doesn’t check the mime type, it assumes the programmer did that. I’m not against making a new mime type or specification, but there are already so many and making more doesn’t seem to help. Yes it would be nice if PHP and Python implement the logic for ignoring trailing commas the same way, but 99% of the time that isn’t all that important. Yes there will be cases where it matters and bugs are introduced, but since there already significant differences between JSON parsers I don’t see these kinds of things as making it much worse.

zeroimpl··on JSON with Commas and Comments
Rather than keep making new variants of JSON, it'd be nice if somebody could convince some mainstream language maintainers to just update their built-in JSON parser to add optional features like skipping over comments and not caring about trailing commas. Most parsers support various flags already to configure things, so there could just be an ALLOW_COMMENTS flag and ALLOW_TRAILING_COMMAS flag.

As a case in point, the python parser breaks the JSON spec already with regards to Infinity/NaN, but then has flags to configure this. See https://docs.python.org/3/library/json.html#module-json

> The RFC does not permit the representation of infinite or NaN number values. Despite that, by default, this module accepts and outputs Infinity, -Infinity, and NaN as if they were valid JSON number literal values:

zeroimpl··on Dyson air purifier outperformed by cheap DIY box fan filter in Marketplace test
If the only metrics you are comparing is price and purification level, then of course you won't want a Dyson. But there are other important objective metrics such as size and loudness which deserve to be a part of any scientific comparison.

If the box fan is bigger and 4x as noisy, it's not a valid comparison for many situations. Instead should compare fans which are similar sizes and operating at similar noise levels.

I have a Dyson fan and a box fan (not air purifiers), and the Dyson fan is significantly quieter, smaller (same height but about half as wide), while having a similar power (not exactly sure which one is stronger).

zeroimpl··on Stop defacing quotes with brackets
Whenever I see “go home and bite [his] pillow”, I’ve always assumed the person spoke quickly and/or skipped a word, which the editor thought should be added. It never occurred to me before now that the editor actually replaced a word!
zeroimpl··on An unexpected find that freed 20GB of unused index space in PostgreSQL
They support index-only scans now, so there is some sort of optimization which bypasses the table lookup, at least in certain cases.
zeroimpl··on Apple Silicon M1 supports “billion of colors” a.k.a. HDR 10-bit output
The 8-bit vs 10-bit aspect is entirely unrelated to the HDR vs SDR aspect.

10-bit is just added precision in your numbers, and ought to be interpreted as adding more decimal places (makes more sense when you imagine the values going from 0-1 instead of 0-255).

HDR is indicated as a bit somewhere in metadata to tell the downstream components how to interpret the pixel values.

To be extra pedantic, HDR is a bit to indicate how to interpret the brightness (luma) channel. There will be other bits for signaling how to interpret the color channels.

Often these things are all done together, which is generally referred to as HDR10.

zeroimpl··on Why Do We Keep Reading the Great Gatsby?
I loved reading, but hated every book I had to read in high school. Just couldn't relate to them. Only later did I realize most of them were pretty good and meaningful.
zeroimpl··on Apple is blocking Apple Silicon Mac users from sideloading iPhone apps
Is it common in the Windows world for you to be able to copy software which you purchased on one device onto another device and expect it to work? Last I checked DRM is still the norm over there. Note that if the OS didn’t do this, you can bet the app developers would be including their own anti-piracy checks in the apps.
zeroimpl··on Apple Fixes Bagel Emoji (2019)
A good bagel doesn’t need filling, nor even to be sliced. A few sesames on top is perfect.
← PreviousPage 8 of 15Next →