HN user

spappal

52 karma
Posts0
Comments30
View on HN
No posts found.
JSONB has landed 3 years ago

Align with the rest of the system, when sqlite is used as a component in a system which mainly speaks json.

Performance, when records are complex and usually not accessed.

Ease, avoiding/postponing table design decisions.

Flexibility, for one of many corner-cases (since sqlite is a very broad tool).

Incremental enhancement, e.g. when starting with sqlite as replacement to an ndjson-file and incrementally taking advantage of transactions and indexes on fields [1,2,3].

For example, several of these could apply when doing structured logging to a sqlite database.

    [1]: https://www.sqlite.org/expridx.html
    [2]: https://www.sqlite.org/gencol.html
    [3]: https://antonz.org/json-virtual-columns/
    See also: https://www.sqlite.org/json1.html

The reason for magnetic field strength falling off as 1/r^3 is interesting: the biot-savart law says that magnetic field falls off as 1/r^2 from a magnetic source, but in reality sources tend to be better approximated by magnetic dipoles than magnetic monopoles. A "north pole" is always accompanied by a "south pole", and at distance there are "interaction effects" such that a part of the field strength is "canceled out".

https://en.wikipedia.org/wiki/Magnetic_dipole

https://en.wikipedia.org/wiki/Magnetic_monopole

the properties of the hashes [g]it uses

Git uses SHA-1, a hardened version since 2017, and are now doing per-repo upgrades to SHA-256 [0]. Lots of repos are presumably still on SHA-1 (and users on older versions of git).

As of 2020, chosen-prefix attacks against SHA-1 are now practical. [verbatim from 1] But I don't think second preimage attacks are practical yet.

Linus Torvalds argued in 2006 basically that it's irrelevant whether git's hash function is second preimage resistant. Selective quoting:

remember that the git model is that you should primarily trust only your _own_ repository [2]

[a malicious] collision is entirely a non-issue: you'll get a "bad" repository that is different from what the attacker intended, but since you'll never actually use his colliding object, it's _literally_ no different from the attacker just not having found a collision at all [2]

All that is just to say: git originally chose its hashes for the above mentioned "git model", thus didn't 100 % care about second preimage resistance. For your suggested search engine, depending on how the database is collected you might not be able to trust "your own repository" (if it's crowdsourced I could register another codebase with the same hash as Linux). A second preimage resistant hash function would be a requirement for the suggested use case.

[0] https://git-scm.com/docs/hash-function-transition/

[1] https://en.wikipedia.org/wiki/SHA-1#cite_ref-8

[2] https://marc.info/?l=git&m=115678778717621&w=2

Compact summaries are useful when revisiting something that was learnt before. Such a document might be more useful for mathematics than most subjects, since many have studied maths but stopped using it, and those teachings are generally still true and relevant.

The doc would be at least 20 % more useful to me if the pdf had a table of contents. Should be easy to include assuming that it was written with latex. Opinion: when writing a lengthy latex document, the extra 0.5 % of work required to add automated pdf metadata (table of contents, clickable references) has outsized usability effects.

I stumbled upon typos:

* "Basel problem formula": pi should be squared.

* The "more general" statement related to Bayes theorem lacks a right parenthesis.

And PEP 8 doesn't mention sorting the imports. There are even counterexamples which aren't alphabetically sorted. It does mention grouping though.

Since Python imports can have side effects, the order can matter. But to the extent that it doesn't break anything, alphabetically sorted groups seems deterministic and readable.

I think this might be the most popular implementation for auto-sorting: https://pypi.org/project/isort/

P(simultaneously within middle 50 % of n independent distributions) = 0.5^n = 2^(-n), like my parent comment says.

But interestingly, every relevant comment here either got something wrong about the final frequency or percentage, or corrected the wrong thing. (Parent comment, grandparent, 2 aunts and 1 cousin.)

0.5^10 = 2^-10 = 1/(2^10) = 1/1024 [i.e. exactly 1 person per 1024] ~= 0.00097656 ~= 0.09766 %.

remember that deaf-blind people exist [... ...] able to understand language

I got curious if/how deafblind people learn to communicate in the first place, if they are completely deafblind from birth. If humans can learn not just communication but language without either vision or hearing, that seems to suggest either extreme adaptability or language learning being quite decoupled from vision and hearing. From an evolutionary standpoint, I imagine that both deafness and blindness are probably uncommon enough that language learning could have explicit dependencies on both hearing and vision.

I found an old-looking video about communication with deafblind people. At the linked timestamp is a woman who is deafblind since age 2.

https://youtu.be/usaf3bVVvjY?t=840

I agree that Deep Work is worth a read. Quite a few meaningful ideas in quite few pages. The end-of-day shutdown is one of the ideas that stuck in me. After a workday my mind is usually buzzing a bit too much for most activities. Focusing on winding down helps very much. Having accepted the point made by the author in combination with it being such a small thing to say the phrase when walking from work means that I often remember to say the phrase and then instantly accept that I should focus the last drops of work-related attention on disconnecting from work in a good way. Helps me a lot!

Over time, I expect editors like VSCode to edit Jupyter notebooks natively.

PyCharm has support for Jupyter notebooks [1], but for now it's not very good [2]. Two weeks ago Jetbrains released this official comment [2]:

Hi, we are aware of the problems our Jupyter support has and we aren't going to fix them, because the current support is going to retire. Currently we are working on another support of Jupyter notebook (even 2!), which hopefully will be better and much more usable. We plan to make it ready for 2018.3 PyCharm release, so stay tuned.

My note: The current PyCharm is version 2.2.

[1] https://www.jetbrains.com/help/pycharm/using-ipython-noteboo...

[2] https://intellij-support.jetbrains.com/hc/en-us/community/po...

Signal Foundation 8 years ago

Signal has no per-group notification settings

Yes it has, at least on Android. Within a group, press the three-dots-menu on top and choose mute notifications. You can choose for how long they shall be muted, similarly to other apps.

Adding to your list:

- Working backups for text and media.