HN user

lucgommans

961 karma

https://lucgommans.nl

Posts28
Comments134
View on HN
stackoverflow.com 1y ago

Why is appending to the innerHTML property bad?

lucgommans
4pts2
kagi.com 1y ago

Most promoted and blocked domains on Kagi

lucgommans
379pts182
www.sciencedirect.com 1y ago

Wireless laser power transmission: Recent progress and future challenges

lucgommans
1pts0
merlijn.sebrechts.be 1y ago

Llama's Legal Labyrinth

lucgommans
5pts1
www.smh.com.au 2y ago

Sucked feet first down the tube (2010)

lucgommans
16pts4
chaos.social 2y ago

Signal is rolling out quantum-safe key exchanges

lucgommans
4pts3
privacytests.org 2y ago

Privacytests.org: open-source tests of web browser privacy

lucgommans
9pts0
stackoverflow.com 2y ago

What's Inside ––Begin (RSA) Public Key–– Files?

lucgommans
1pts1
github.com 3y ago

Reddit comments-per-minute stats normalized to time-of-day and day-of-week

lucgommans
12pts0
anyz.one 4y ago

AnyZone – DNS delegations without configuring a domain

lucgommans
1pts0
github.com 4y ago

Library and command line tool to detect SHA-1 collisions (2017)

lucgommans
9pts0
github.com 4y ago

Threema is coming to F-Droid

lucgommans
23pts4
f-droid.org 4y ago

Wire is now on F-Droid

lucgommans
282pts238
icelandmag.is 4y ago

Leader sheep's exceptional intelligence not folklore, study proves (2015)

lucgommans
3pts1
en.wikipedia.org 4y ago

Keystroke-level model: predict how long a task takes with different UX designs

lucgommans
1pts1
hashcat.net 5y ago

Hashcat v6.2.0 Released

lucgommans
3pts1
lucgommans.nl 5y ago

Show HN: Check whether your symptoms were likely COVID-19

lucgommans
2pts3
security.stackexchange.com 6y ago

Keybase's chat in the app was never verifiably end-to-end encrypted

lucgommans
28pts0
www.leta.lv 6y ago

Airspace over Riga Airport closed over lost drone

lucgommans
1pts1
security.stackexchange.com 6y ago

How can I verify Keybase's end-to-end encryption between me and a friend?

lucgommans
3pts2
www.youtube.com 6y ago

Poverty isn't a lack of character; it's a lack of cash

lucgommans
20pts8
lgms.nl 7y ago

No more XS4ALL is unthinkable

lucgommans
328pts125
lgms.nl 8y ago

GDPR is nearly identical to the previous law

lucgommans
2pts0
tryton-vanmeer.github.io 8y ago

Yes, I am a Linux gamer

lucgommans
2pts0
security.stackexchange.com 8y ago

Consequences of the WPA2 KRACK attack

lucgommans
3pts0
lgms.nl 8y ago

The Dutch demand referendum on new dragnet surveillance law

lucgommans
1pts0
lgms.nl 10y ago

AdRefund

lucgommans
3pts0
lgms.nl 11y ago

Breaking Grooveshark's encryption

lucgommans
99pts33

would love to see more tooling to lint and sanitize them before deployment

Sanitisation is one of two possible defences, the other being script execution controls or sandboxing. E.g., if you serve vector images on a web server, set a Content Security Policy header¹ for all your images that simply denies all scripting. You can also run it from a dummy domain ('origin') with nothing valuable on it (like how domains such as googleusercontent.com and githubusercontent.com are being used)

For sanitisation, DOMPurify² is the only widely used and tested library that I know of. It could use more bindings for other languages but, if you can call into it, it can go in your deployment pipeline. (Disclosure: I've worked with some of the people at Cure53, but not on this project)

You can also combine the approaches for defence in depth

¹ https://developer.mozilla.org/en-US/docs/Web/HTTP/Guides/CSP

² https://github.com/cure53/DOMPurify

The website has no open data license so this isn't usable for OSM, even if we wanted to. I just meant to propose collaborating on an existing platform where we already have a lot of data about physical features, rather than erecting an ephemeral platform for this special purpose

More than 200 hotels already on this website. Wouldn't this be much more useful as an OpenStreetMap tag so people can find and share these good/bad hotels in whatever front-end they like?

There does not seem to be a tag for it yet. That there are apparently hundreds of instances, and it being definitely something you'd want to select for, makes me think it's a good fit for OSM. Currently, hotels can already have tags like phone number, reception opening hours, WiFi fees, etc. It might even be a good fit for the toilets:* namespace, since this has overlap with toilets in (semi-)public spaces offering different levels of privacy

Or if you need records other than A/AAAA, like MX for delivering email: https://anyz.one

e.g. 10.2.3.4.anyz.one will refer the recursive resolver to query 10.2.3.4 for the answer to the query. You can also buy a domain and configure it to do that, but this is quicker

Disclosure: I wrote anyzone

It’s been difficult to remove [old JPEG] from its perch. [...] the formats AVIF and HEIC, each developed by standards bodies, have largely outpaced [JPEG]

I'm currently sticking to JPEG because, last time I tried, JPEG came out as the best format. Referencing my memory at https://chaos.social/@luc/113615076328300784

- JPEG has two advantages on slow connections: the dimensions are either stored up front so the layout doesn't jump, or maybe the renderer is better; and it loads a less-sharp version first and progressively gets sharper

- JPEG was way faster when compressing and decompressing

- on the particular photo I wanted to optimise in this instance, JPEG was also simply the best quality for a given filesize which really surprised me after 32 years of potential innovation

Regarding AVIF, my n=1 experience was that it "makes smooth gradients where jpeg degrades to blotchy pixels, but at decent quality levels, jpeg preserves the grain that makes the photo look real". Gradients instead of ugliness at really small sizes can be perfect for your use-case, but note that it's also ~80 times slower at compression (80s vs. <1s)

JpegXL isn't widely in browsers yet so I couldn't use it

These days, the [JPEG] format is similar to MP3

The difference with mp3 is that Opus is either a bit better or much better, but it's always noticeably better.

You can save ~half the storage space. For speech (audio books) I use 40kbps, and for music maybe 128kbps which is probably overkill. And I delete the originals without even checking anymore if it really sounds the same, I noticed that I simply can't tell the original apart in a blind test, no matter what expensive headset setup I try

TFA attributes it to a simple "they were first" advantage, but I think this is why "Why JPEGs still rule the web": no file format is better than JPEG in the same way as Opus is better than MP3; in that you don't have to think about it anymore and it's always a win in either filesize or quality

That said, Opus is also annoyingly hard to get into people's minds, but I've done it and you also see major platforms from compress-once-serve-continuously video (e.g. Youtube) to VoIP (e.g. Whatsapp) switching over for all their audio applications

I knew changing innerHTML had some side effects, but this answer shows just how many corner cases it causes and offers a drop-in replacement at least for appending. Thought other developers on this site would also be interested to learn this

Taken to an extreme without formatting, sure, but what ranges have that many digits in human-readable situations? And if there are those exception situations, you can word around it for that case ("285368760800±45691" or "45'691 years after 285'368'737'954")

Genuinely trying to think of an examples, since e.g. books aren't ever that long and search results don't have that many pages (that you'd all read and refer back to). A salary range, perhaps, can get into the seven digits in extreme cases (not that you care about any individual digit when you make a lifetime's worth of money in a bit more than a year): "Prospective salary is 2'423'000 to 2'432'000" seems to convey the relevant info as well as "Prospective salary is 2'423'000 to 9'000" does (except that I wouldn't understand the latter and ask what this second number means, but that's plausibly attributable to me as an individual not being used to it)

I really like alternativeto. It's not always good: sometimes there are simply no good alternatives, or the community hasn't voted for the ones I'd have voted for and so a good option is way, way down. But if I want to know alternatives, I go there directly, so I guess that's maybe why people block it from appearing in random search results? I found it puzzling to see a useful site blocked (especially when I haven't seen it appear much in search results, but then, I've also been using DDG primarily, which ranks things rather differently)

I don't understand. Opening the page in a logged-out state, it looks the same to me (just that there are not buttons to pick whether you want to raise/lower/block a domain when you're logged out). What's the different view you mean?

If only it was merely useless. I know its reputation but it had some information that MDN did not have, so I used it this once in recent years. Turned out, the information was simply wrong and so I made a wrong decision based on that. (It might have been about favicon format support in different browsers. Presumably it was Safari that never had support for vector graphics whereas w3schools listed it as such, and it's not like you can just download Safari to double check.) Regardless, what I'm sure about is that I alerted them to whatever the problem was, but for me it was the last nail in that coffin

Is this meaning to grep for a double hyphen from standard in, or to mark the start of positional arguments and then grep for a hyphen? If you want both, it should be:

    $ python -m this | grep -- -- -
Which is just beautiful

(Your example causes the last hyphen to be grepped for, which happens to only match doubled-up ones because single ones don't occur in that text. The quotes/apostrophes do nothing because they're parsed by (ba)sh and so only the hyphens are passed to grep, not the quotes. The last hyphen can be omitted because reading from stdin is the default if neither filenames nor recursion options are passed.)

It is usually clear that 2-3 thingies means a range of thingies, but I seem to remember there being situations where it could also have been a minus sign. Perhaps it was with placeholders, where 10-N could be either one. Problem is, iirc, the real minus sign is longer than the hyphen, looking like an en dash (the one meant for ranges) and so it defeats the purpose... hence I totally use hyphens as minus signs, but en dashes for ranges, which makes sense in my head because a range has a certain span/length whereas a minus sign is just a little mark to indicate that something is negative. I see lots of people/software use en dashes for ranges but the existence of a real minus sign is, from my perspective, mostly just noted in typographic resources, so I think this reflects most people's usages (for the people that care for these details)

I do like that the em dash is as long as it feels that broken-off thoughts should be

Not everything has to be functional, sometimes things can also just look nice for the sake of it

Literally never seen this (wish I could grep all comments I've ever replied to) and I do not understand what makes you say that it's clearer when it's dropping information, making it relative rather than a fully qualified number

In speech, it's common, and misunderstandings are usually not a problem (if you're not monologuing on a recording) because someone will just ask; but in writing it looks like the range is the wrong way around. Maybe I expect more care in writing because the feedback loop is longer, or maybe it's just habit and I think it's wrong in writing because I never see it?

Rehosted so it'll stay alive at least a few years: <https://lucgommans.nl/tmp/YYZ_Crash.mp3>. Let me know if you'd like something more permanent than my tmp dump folder, or a filename that gives credits or so! (BTW if you're editing clips, I can recommend exporting to Opus instead of ancient MP3: released in ~2012 so support is very good by now and it's like twice the quality at the same file size, probably even better for speech)

I compared Shazam's, SoundHound's, and BeatFind's recognition library in August 2021. (And tried MusixMatch but it crashed on startup apparently.) Don't think I published it anywhere, these are my raw notes I found among saved chat messages. The format is starting to make more sense now that I'm putting it into a wider window than a chat screen, so I can recommend using a wide browser (94 characters per line should do it). Eyeing the song choices, it looks like I tried to find different genres and artist types (ccMixer/youtube celebrities, to indie, to established) but a larger sample size would obviously have been even better. Still, I hope it's one step up from adding another random opinion!

The conclusion appears to be that BeatFind and Shazam know the most songs, but are also somewhat complementary and all of the services had at least one song they uniquely recognised.

---

    Fun facts:
     * Night Driver (W) said "1 Shazams". I think I was the first person to ever Shazam that. Some of the most obscure things had hundreds, often thousands of shazams!
     * You know where they are taking the hobbits but none of the services do!

    ========

    - ABC = found the song
    - # = number of attempts
    - f = exceptionally fast matching (when it did match, might not be first attempt)
    - ~ = knew one of the songs

    BeatFind:     2B  C     1E    2G 2H  1I  2Jf 2Lf 4M 2Nf 2Of 1Pf 1Rf ~S 2T  1Uf 1Vf 1W 1Xf Y Z
    SoundHound: A 1B        1E 2F 1G 2H  2If     1L         2O  3P  2R     1Tf 2U
    Shazam:       1Bf    1D 1E 1F 1G 1Hf 1I  2J  1L  1M 4N  1O  1Pf 1Rf    1Tf 1Uf 1V  2W 1X  Y Z
    MusixMatch: crashes on startup, presumably it realizes it won't be able to show me ads

    missingno
    Shazam:     A C K Q S
    SoundHound: C D F J K M/N Q S V W X Y Z
    BeatFind:   A D F K Q

    non-universal finds (repeated letter = unique = counts double; slash means same artist so should be counted as one)
    Shazam:     DD F J M/N V X Y Z
    SoundHound: AA F
    BeatFind:   CC J M/N S V X Y Z

    A: Levan Polkka Epic Orchestral Cover version
    B: Pokémon red/blue soundtrack
    C: Mayhem (various songs, it seems either they have all or they have none)
    D: Art Now ft. Snowflake
    E: Hero's Choice
    F: Three Days Grace - Scared
    G: Syrian - Supernova
    H: The Explosion - Here I Am
    I: The Von Bondies - C'mon C'mon
    J: Frank Klepacki - Scouting (C&C TibSun)
    K: Conspiracy - Chaos Theory (demoscene)
    L: Cheshyre - Madness6 (remix) (Newgrounds ID 77998)
    M: Dimrain47 - Twilight Techno
    N: Dimrain47 - Cloud Control
    O: DragonForce - My Spirit Will Go On
    P: Yuki Kajiura - The First Town (SAO)
    Q: THEY'RE TAKING THE HOBBITS TO ISENGARD! THE HOBBITS- THE HOBBITS- TO ISENGARD! TO ISENGARD!
    R: Faithless - Insomnia
    S: Age of Empires 1 soundtrack
    T: Moulin Rouge - El Tango De Roxanne
    U: Van Canto - Master of Puppets
    V: Slack Bird - Jouni
    W: Floppytronic - Night Driver
    X: EgoSalad / Kitboga - Breathe in
    Y: Floppy Drive music: top 4 hits on yt: sweet dreams, imperial march, ghostbusters, beat it. Only ghostbusters was known to any
    Z: Obsidian Shell - Orphanage
---

Note that what I did not test/review introducing noise (like people talking through it) or filtering (like when you hear the music through a wall)

I gave it some thought but it's hard to say. For most of the ones I missed and mentioned in sibling threads, I can think of people who'd be aware of them:

- Probably <ruby> and related tags are used in Japanese and other spheres with such a language feature

- <base> I knew of, I thought archive.org used it but apparently not currently. Probably if you work with archived or otherwise namespaced content, you can reasonably find this a very familiar element

- <track> if you're a media person, doesn't seem that outlandish

- <dfn> I knew of basically, but just couldn't recall the names for glossary tags

- <kbd> is used all the time on Superuser (in Markdown, where HTML is valid though of course they filter most of it)

- Some others that I didn't remember, like <template> and <article>, were just stupidity. I know these...

This leaves <del> and <ins>. There are enough diffing tools, but it's not as big a category of software people constantly work on, especially since this is only for browsers. I'd not be surprised if these are the most-forgotten elements

Or does anyone still use <map>? I saw it in the HTML tutorial (linked from a Dutch magazine) that got me into programming so I know of it and remembered while doing the quiz, but it's fairly far faded from my mind and I'm not sure anyone would ever use it when, if you want this sort of functionality, you'd probably want the versatility of JavaScript

I tried the exact same three! Eventually gave up on that path, thinking "I could swear HTML had some way to have a glossary...", and of course seeing it does after revealing the answers

<img> also took me the longest time, and <br> even longer though I used it within the last hour, but the facepalm moment came when I almost decided to give up and then remembered <h1> through <h6>. I even knew how many levels existed! Not that I didn't try h7 for good measure, one can't be too sure with these things :-)

If you want to see which ones you've missed, put this in the JS console:

    Els.filter((item) => {return ! Elsguessed.includes(item)})
In Firefox (probably also in other browsers), links in the console are also clickable, so if you want to look any up, printing them as a link may be helpful:
    Els.filter((item) => {return ! Elsguessed.includes(item)}).map((item) => {console.log(`https://developer.mozilla.org/en-US/docs/Web/HTML/Element/${item}`)})
I got to 80 found / 34 remaining (plus, of course, various deprecated tags and some which I'm very surprised were not deprecated such as map). Of the remaining ones, I've used several in the past and would have been able to say what they do... stupid memory is bad at enumeration!

I guess the OSM community is more defaulting to developing for other open platforms because that's what we mostly use ourselves and can test/run the code on, but iOS is in the making:

Pinned ticket "iOS - Planning": https://github.com/streetcomplete/StreetComplete/issues/5421

See also the project board: https://github.com/orgs/streetcomplete/projects/1/views/1 showing quite a few things already done, some in progress, and a handful todo or blocked each

It's a hundred times less polished than rebound (that readme looks seriously cool!), but in 2021 I also wanted to toy around with orbital mechanics / gravity and couldn't find a quick and easy simulator so I made this to run in a browser: https://lucgommans.nl/p/badgravity/

Since it's so rough on the edges (especially on mobile, initially I was surprised it works at all), here's the steps for the mentioned example of making Jupiter 10x heavier:

    1. Open the scenarios on the left and click play on the inner solar system to load that up
    2. Click the plus on the outer planets to add them in (if it looks like nothing happened: zoom out. Space is big and this is to scale)
    3. Fold out the "bodies" section and alter the mass for "J"upiter. The change is applied live.
    4. Optionally press Restart to restart with the current settings but back at their initial positions and speeds
Making Jupiter 1000× heavier (and fast-forwarding the time in the Simulator controls by 10×) makes it eject Mars from the solar system within one minute, but interestingly Mercury and Venus seem pretty stable around the sun in that configuration

The help/about page (https://lucgommans.nl/p/badgravity/about.html) contains links to all other orbit projects I could find. Seeing Rebound as well as the OP, I should probably add a "libraries" section! Or do you think that should just go with "Software to download" alongside Stellarium and such?

A white dwarf's density is apparently around 1e9 kg/m³. Olympic swimming pools at 50m*25m*2m * 1e9kg/m³ would have a weight of 2.5e12 kg. As a sphere, the radius is (solving: volume_of_sphere = 4/3×π×radius³)

    $ qalc 50m*25m*2m = 4/3*pi*x^3
    (((50 * meter) * (25 * meter) * (2 * meter)) = ((4 / 3) * pi * (x^3))) =
    approx. (x = 8.4194515 m)
Gravitational acceleration (for a point mass) is: the gravitational constant, multiplied by the mass, divided by the radius squared, and we want the result in Earth gravities:
    $ qalc G * 2.5e12kg / 8.4194515² m² to gee
    (newtonian_constant * ((2.5 * (10^12)) * kilogram)) / ((8.4194515^2) * (meter^2)) =
    approx. 0.24 gee
You're only one order of magnitude off — if this is correct, which I am really not sure about!

Sources: https://en.wikipedia.org/wiki/White_dwarf · https://en.wikipedia.org/wiki/Olympic-size_swimming_pool · https://duckduckgo.com/?q=volume+of+a+sphere&ia=answer · https://www.wolframalpha.com/input?i=surface+gravity+calcula...

What I'm even less sure how to calculate is whether an 8-meter sphere can be that heavy. Uranium is ~2e4 kg/m³, but under its own gravity, things shrink until they reach black hole status (infinite smallness; perceived size coming from its event horizon). Basically I'd want to turn the above 1e9kg/m³ into an unknown, but what's the formula for mass given your specified radius and gravitational acceleration? TBD

I'm really curious if this was just a few words strung together and it happened to come out to within one order of magnitude by pure coincidence, or if (how) you calculated this!

Rather than teaching a separate utility, I would recommend qalc which has unit conversions built in :)

    $ qalc -t 100km/h / 0.956s to gee
    2.9629132 gees
(where -t is for terse mode; by default it expands unit abbreviations and adds parentheses so you see whether it did what you wanted)

The reason I recommend it is because it does so much more, I really love this utility since discovering it about a year ago. Example of using time notation combined with uncertainty and unit conversion:

    > (18:41 - 09:00+/-00:30) hours * 250 W to kWh
      (((1121 / 60) - (9±0.5)) * hour) * (250 * watt) =
      approx. (2.4208333±0.125) kW*h