In this example, posts have tags. When a post is deleted, we check to see if there are now any empty tags, and now we want to delete any empty tags that the post deletion may have created.
If we are creating and deleting posts concurrently, a naive implementation might wrongly delete the tags of a newly created post.
This could be due to a concurrency issue of the following types.
Failure case 1:which would result in the new post incorrectly not having the
- thread 2: delete old post
- thread 2: find all tags with 0 posts. Finds
tag0from the deleted old post which is now empty. - thread 1: create new post, which we want to have tag
tag0 - thread 1: try to create a new tag
tag0, but don't because it already exists, this is done using SQLite'sINSERT OR IGNORE INTOor PostgreSQL'sINSERT ... ON CONFLICT DO NOTHING - thread 1: assign
tag0to the new post by adding an entry to the join table - thread 2: delete all tags with 0 posts. It still sees from its previous search that
tag0is empty, and deletes it, which then cascades into the join table
tag0.Failure case 2:which leads to a foreign key failure, because the tag does not exist anymore when the assignment happens.
- thread 2: delete old post
- thread 2: find all tags with 0 posts
- thread 1: create new post
- thread 1: try to create a new tag
tag0, but don't because it already exists - thread 2: delete all tags with 0 posts. It still sees from its previous search that
tag0is empty, and deletes it - thread 1: assign
tag0to the new post
Failure case 3:which leads to a foreign key failure, because the tag does not exist anymore when the assignment happens.
- thread 2: delete old post
- thread 1: create new post, which we want to have tag
tag0 - thread 1: try to create a new tag
tag0, and succeed because it wasn't present - thread 2: find all tags with 0 posts, finds the tag that was just created
- thread 2: delete all tags with 0 posts, deleting the new tag
- thread 1: assign
tag0to the new post
Sample executions:All executions use 2 threads.
node --unhandled-rejections=strict ./parallel_create_delete_empty_tag.js p 9 1000 'READ COMMITTED': PostgreSQL, 9 tags, DELETE/CREATE thetag0test tag 1000 times, useREAD COMMITTEDExecution often fails, although not always. The failure is always:because the:error: insert or update on table "PostTag" violates foreign key constraint "PostTag_tagId_fkey"tries to insert a tag that was deleted in the other thread, as it didn't have any corresponding posts, so this is the foreign key failure.INSERT INTO "PostTag"node --unhandled-rejections=strict ./parallel_create_delete_empty_tag.js p 9 1000 'READ COMMITTED' 'FOR UPDATE': do aSELECT ... FOR UPDATEbefore trying toINSERT.This is likely correct and the fastest correct method according to our quick benchmarking, about 20% faster thanREPEATABLE READ.node --unhandled-rejections=strict ./parallel_create_delete_empty_tag.js p 9 1000 'REPEATABLE READ': repeatable readWe've never observed any failures with this level. This should likely fix the foreign key issue according to the PostgreSQL docs, since:- the
DELETE "Post"commit cannot start to be seen only in the middle of the thread 1 transaction - and then if DELETE happened, the thread 1 transaction will detect it, ROLLBACK, and re-run. TODO how does it detect the need rollback? Is it because of the foreign key? It is very hard to be sure about this kind of thing, just can't find the information. Related: postgreSQL serialization failure.
- the
node --unhandled-rejections=strict ./parallel_create_delete_empty_tag.js p 9 1000 'SERIALIZABLE': serializablenode --unhandled-rejections=strict ./parallel_create_delete_empty_tag.js p 9 1000 'NONE': magic value, don't use any transaction. Can blow up of course, since even less restrictions thanREAD COMMITTED
Some theoretical notes:
stackoverflow.com/questions/10935850/when-to-use-select-for-update from SELECT FOR UPDATE also talks about a similar example, and has relevant answers.
Unlike SARS-CoV-2 non-structural protein, these are not needed for test tube reproduction. They must therefore be for host modulation.
Vimscript unit testing!!!
You need a secondary password that when used leads to an empty inbox with a setting set where message are deleted after 2 days.
This way, if the attacker sends a test email, it will still show up, but being empty is also plausible.
Bought May 2024 to be my clean crypto-only computer. Searched for cheapest 1 TB disk 16 GB RAM not too old on Amazon with Ubuntu certification, and that was it at £479.00.
Some reviews:
OPSEC: will run only cryptocurrency wallets and nothing else. Will connect to Internet, but never ever to a non clean USB flash drive.
Bootstrap OPSEC:It must have taken about one week running full time to sync the Monero blockchain which at the time was at about 3.1M blocks! I checked on system explorer, and CPU and internet usage was never maxed out, suggesting simply slow network. But the computer still overheated quite a bit and froze a few times.
- turn on from factory, start Windows 11 Home 23H2 build 22631.2715, connect to home Wifi during setup process. Considered skipping WiFi, but I'll want to download the Ubuntu ISO later on anyways answers.microsoft.com/en-us/windows/forum/all/bypass-lets-connect-you-to-a-network/2ce188f6-1b28-45a0-97d2-bfccfa3c9188. Don't sign in to online Windows account, and turn off all spyware requests.
- on preinstalled Edge browser, download Ubuntu 24.04 ISO from ubuntu.com, check sha256 with
Get-FileHashon powershell even though that is pointless security.stackexchange.com/questions/1687/does-hashing-a-file-from-an-unsigned-website-give-a-false-sense-of-security, download balenaEtcher portable from etcher.balena.io/ (currently recommended burner at ubuntu.com/download/desktop#how-to-install) from etc, and burn Ubuntu into a SanDisk Ultra Flair 64 GB - install Ubuntu from USB flash. No internet connection initially, default everything.
- notice that Ubuntu 24.04 is too broken, install Ubuntu 22.04.4 on the previously used USB from Ubuntu, and then install 22.04 instead... minimal installation, encrypted ZFS
- Ubuntu 24.04 "The application files has closed unexpectedly". This likely terminated uncompression of the bz2 halfway, and led to a corrupted monerod...
- askubuntu.com/questions/15520/how-can-i-tell-ubuntu-to-do-nothing-when-i-close-my-laptop-lid fix the eternal laptop lid issue without GUI solution...
- copy view only wallet private key by takinga picture of the QR code with Android cell phone. This gives it to the CIA immediately, but that's fine as we're going to publish it publicly.
If you are going to do closed source, at least do it like this.
Basically the opposite of need to know for software.
Last updated 2018 as of 2021, but still just worked.
Gotta run github.com/feathersjs/feathers-chat first: github.com/feathersjs-ecosystem/feathers-chat-react/issues/5, then it worked:and on the other terminal:then visit localhost:3000/ and you can create an account and login, tested on Ubuntu 20.10. Data is stored on persistently.
git clone https://github.com/feathersjs/feathers-chat
cd feathers-chat
git checkout fd729a47c57f9e6170cc1fa23cee0c84a004feb5
npm install
npm startgit clone https://github.com/feathersjs-ecosystem/feathers-chat-react
cd feathers-chat-react
git checkout 36d56cbe80bbd5596f6a108b1de9db343b33dac3
npm install
npm startIf you disable JavaScript on Chromium, it stops working completely. There is a section on how to solve that at: docs.feathersjs.com/cookbook/express/view-engine.html but it does not cover React specifically. Codaisseur/feathersjs-react-redux-ssr might be good to look into.
To run each example and see the output run:
./build.sh
xdg-open out/index.htmlWays in which it can happen:
Pinned article: Introduction to the OurBigBook Project
Welcome to the OurBigBook Project! Our goal is to create the perfect publishing platform for STEM subjects, and get university-level students to write the best free STEM tutorials ever.
Everyone is welcome to create an account and play with the site: ourbigbook.com/go/register. We belive that students themselves can write amazing tutorials, but teachers are welcome too. You can write about anything you want, it doesn't have to be STEM or even educational. Silly test content is very welcome and you won't be penalized in any way. Just keep it legal!
Intro to OurBigBook
. Source. We have two killer features:
- topics: topics group articles by different users with the same title, e.g. here is the topic for the "Fundamental Theorem of Calculus" ourbigbook.com/go/topic/fundamental-theorem-of-calculusArticles of different users are sorted by upvote within each article page. This feature is a bit like:
- a Wikipedia where each user can have their own version of each article
- a Q&A website like Stack Overflow, where multiple people can give their views on a given topic, and the best ones are sorted by upvote. Except you don't need to wait for someone to ask first, and any topic goes, no matter how narrow or broad
This feature makes it possible for readers to find better explanations of any topic created by other writers. And it allows writers to create an explanation in a place that readers might actually find it.Figure 1. Screenshot of the "Derivative" topic page. View it live at: ourbigbook.com/go/topic/derivativeVideo 2. OurBigBook Web topics demo. Source. - local editing: you can store all your personal knowledge base content locally in a plaintext markup format that can be edited locally and published either:This way you can be sure that even if OurBigBook.com were to go down one day (which we have no plans to do as it is quite cheap to host!), your content will still be perfectly readable as a static site.
- to OurBigBook.com to get awesome multi-user features like topics and likes
- as HTML files to a static website, which you can host yourself for free on many external providers like GitHub Pages, and remain in full control
Figure 3. Visual Studio Code extension installation.Figure 4. Visual Studio Code extension tree navigation.Figure 5. Web editor. You can also edit articles on the Web editor without installing anything locally.Video 3. Edit locally and publish demo. Source. This shows editing OurBigBook Markup and publishing it using the Visual Studio Code extension.Video 4. OurBigBook Visual Studio Code extension editing and navigation demo. Source. - Infinitely deep tables of contents:
All our software is open source and hosted at: github.com/ourbigbook/ourbigbook
Further documentation can be found at: docs.ourbigbook.com
Feel free to reach our to us for any help or suggestions: docs.ourbigbook.com/#contact





