Live data from Hacker News

Toothpaste Null-Terminator

dunkels.com

21–30 of 81 posts

Re: Toothpaste Null-Terminator

#22

It must also be implememted in toilet paper packs. Last roll should be of different color.

I have seen some brands that do essentially this, e.g.: https://m.media-amazon.com/images/I/61wjeonOCdL._AC_SL1500_....

Personally I just keep a few rolls of single-ply Scott on hand for backup if my stock gets too low.

Re: Toothpaste Null-Terminator

#23
I think the point kind of swooshed me (I notice taking out the last tube as suggested by another comment).

Adam is obviously massively competent and known etc, but as an avid SO poster I have to point out the potential accidental footgun discharge:

In C abs() returns int, you must use fabs(). Not sure about other C-like languages and the article doesn't specify language but still.

Re: Toothpaste Null-Terminator

#24

Buy two tubes, while true, when you finish a tube, add one toothpaste tube to the shopping list, done. Works great for an average person who usually visits the store. Adjust the initial putchase if you visit the store twice a year. Also works great for many suplies like coffee, pasta, legumes...

I just put my running-out items on the entryway table.

Re: Toothpaste Null-Terminator

#25

I don’t understand how this works with systems like toothpaste? I get if you somehow stored your toothpaste in some queue-like structure where you only see 1 at a time, then yes, reaching the last would be helpful. But surely they are in a cupboard or drawer or something? To know to start the sentinel toothpaste he must search around and prove it’s the only one left - by doing this he doesn’t need the sentinel anyway…

The benefit imo here is not that you realize you need more toothpaste only while you search for the last one, it's that while you're using it there's a clear signal to get more.

Re: Toothpaste Null-Terminator

#26
post #12

I don’t understand how this works with systems like toothpaste? I get if you somehow stored your toothpaste in some queue-like structure where you only see 1 at a time, then yes, reaching the last would be helpful. But surely they are in a cupboard or drawer or something? To know to start the sentinel toothpaste he must search around and prove it’s the only one left - by doing this he doesn’t need the sentinel anyway…

I assume OP's solution has thread-safety requirements. The toothpaste may be retrieved from long-term storage by another thread, and that thread may not be configured to check for termination conditions.

Children act more like separate processes than threads - it would be a miracle if we could read their minds or put them to sleep for a bit.

Re: Toothpaste Null-Terminator

#27

Buy two tubes, while true, when you finish a tube, add one toothpaste tube to the shopping list, done. Works great for an average person who usually visits the store. Adjust the initial putchase if you visit the store twice a year. Also works great for many suplies like coffee, pasta, legumes...

Exactly how (and why) I try buy things. Not exactly "bulk" buying but more "at least 2" buying.

Re: Toothpaste Null-Terminator

#28
post #24

Buy two tubes, while true, when you finish a tube, add one toothpaste tube to the shopping list, done. Works great for an average person who usually visits the store. Adjust the initial putchase if you visit the store twice a year. Also works great for many suplies like coffee, pasta, legumes...

I just put my running-out items on the entryway table.

Me too! If I must take out some forgettable item, it sits blocking the door.

Re: Toothpaste Null-Terminator

#29
I use an even simpler and more reliable system to avoid running out of toothpaste: brushing with plain water. Evidence suggests that brushing with toothpaste (called "dentifrice" in scientific papers) does not remove any more plaque than brushing without it. Here's a systematic review from 2016:

>Does dentifrice use help to remove plaque? A systematic review

https://pubmed.ncbi.nlm.nih.gov/27513809/

"The cumulative evidence for this systematic review demonstrates that there is moderate certainty that toothbrushing with a dentifrice does not provide an added effect for the mechanical removal of dental plaque."

However, plaque removal is not the only purported function of toothpaste. It can also serve as a fluoride delivery system, and fluoride has strong evidence for strengthening teeth. I personally drink a lot of tea, which is a fluoride hyper-accumulator, so I'm more concerned with avoiding fluoride, but if you don't drink tea this might influence your decision to use toothpaste.

There are also some toothpastes with antimicrobial ingredients. Those also have strong evidence for actually doing something, although I'm personally skeptical that messing with your mouth's microbiome like that is a good idea.

Additionally, I believe that toothbrush wear is an underestimated factor in cleaning efficacy. Toothbrush bristles are manufactured with microscopic texturing that helps remove plaque. I can feel the difference when changing from a worn to a new toothbrush. Ben Krasnow of Applied Science has a video on Youtube with electron micrographs showing the difference:

https://www.youtube.com/watch?v=cwN983PnJoA

Re: Toothpaste Null-Terminator

#30

Neat, but I prefer my own method: 1. Have two toothpastes (actually two of everything) 2. When one gets used up, remove the checkmark from my shopping list (just a simple checkmark list on my phone in Google notes) 3. When in the store, buy everything that's not checked on the shopping list Works all the time, except during the CoVID toilet paper crisis, which made me increase my prepper level to 3 of everything.

Just a simple 2-queue. I love this, since it's low friction and your essentials are persistent. No more brain-wracking to remember what the grocery list is missing.
Post reply on HN