Memoization And Meemo
Updated on 16 Jan 2014 permalink
Meemo is a tool I wrote a while ago to deduplicate standard input and/or output using custom delimiters.
While that sounds both complicated, and slightly confusing, let’s look at some examples.
There’s a lot to take in here, so we’ll break it down case by case. In the first example, we run
echo and output to show that we’re printing 3 items. After running it through Meemo we can see that we only get 2 items, that’s because by default Meemo uses the newline character (
\n) to delimit chunks that it should deduplicate. This is what Meemo sees:
"abc" DELIMITER "def" DELIMITER "abc" DELIMITER. Then Meemo processes the input by printing out non-delimiters it hasn’t seen before, and prints a delimiter after them. Which works out to be:
In the third case, what happens? All of a sudden Meemo decided not to print anything out. The truth behind the matter, is that Meemo is a smarter tool than has been given credit so far. Meemo permanently remembers everything it sees unless told otherwise. Meemo does this by creating a local cache file of all the things it’s seen before and storing it in
.meemo.cache (by default).
This behaviour lets us run Meemo with part of the dataset today, and another part of it tomorrow. As part of caching the items it has already seen, Meemo can then output the cache later, optionally using a different delimiter.
Meemo is written for python3, and is fairly untested. While it can be embeded into a python application to deduplicate it’s io, that hasn’t really been tested for input.
- Discord Webrtc Logging
- Public Key Change
- A Journal Of History
- Collapsing Contexts
- Cryptography And Backdoors
- Online Personas
- Life On The Internet
- Real Time
- Erlang And Reltool
- Memoization And Meemo
- UW Course Search
- OS 161 Retrospective
- Totp Authentication
- This Site