Popular recipes tagged "caching"http://code.activestate.com/recipes/tags/caching/2012-03-24T14:40:24-07:00ActiveState Code RecipesManage hashes in database files. (Python)
2012-03-24T14:40:24-07:00eysihttp://code.activestate.com/recipes/users/4177096/http://code.activestate.com/recipes/578081-manage-hashes-in-database-files/
<p style="color: grey">
Python
recipe 578081
by <a href="/recipes/users/4177096/">eysi</a>
(<a href="/recipes/tags/caching/">caching</a>, <a href="/recipes/tags/hashes/">hashes</a>).
Revision 4.
</p>
<p>This module can be used to calculate file hashes, store them in a database file
and retrieve them at a later date.</p>
<p>It uses the files modify time stamp to know if it can use the hash stored in
the db or if it has to re-calculate it. So the user will not have to worry
about the hash being incorrect if the file changes in between runs.</p>
Manage hashes in database files. (Python)
2012-03-20T01:08:15-07:00cathy parkhttp://code.activestate.com/recipes/users/4181365/http://code.activestate.com/recipes/578083-manage-hashes-in-database-files/
<p style="color: grey">
Python
recipe 578083
by <a href="/recipes/users/4181365/">cathy park</a>
(<a href="/recipes/tags/caching/">caching</a>, <a href="/recipes/tags/hashes/">hashes</a>).
</p>
<p>This module can be used to calculate file hashes, store them in a database file
and retrieve them at a later date.</p>
<p>It uses the files modify time stamp to know if it can use the hash stored in
the db or if it has to re-calculate it. So the user will not have to worry
about the hash being incorrect if the file changes in between runs.</p>
Minimalistic Memoization (Python)
2010-05-06T16:59:52-07:00Ahmed El Deebhttp://code.activestate.com/recipes/users/4173897/http://code.activestate.com/recipes/577219-minimalistic-memoization/
<p style="color: grey">
Python
recipe 577219
by <a href="/recipes/users/4173897/">Ahmed El Deeb</a>
(<a href="/recipes/tags/caching/">caching</a>, <a href="/recipes/tags/memoization/">memoization</a>, <a href="/recipes/tags/recursion/">recursion</a>).
</p>
<p>Minimalistic Memoization in python, just works, doesn't take care of cleaning up the cache however.</p>
Adaptive Replacement Cache in python (Python)
2008-10-08T12:24:40-07:00eric casteleijnhttp://code.activestate.com/recipes/users/4167234/http://code.activestate.com/recipes/576532-adaptive-replacement-cache-in-python/
<p style="color: grey">
Python
recipe 576532
by <a href="/recipes/users/4167234/">eric casteleijn</a>
(<a href="/recipes/tags/caching/">caching</a>, <a href="/recipes/tags/decorators/">decorators</a>).
</p>
<p>Python implementation of an adaptive replacement cache, as described in:</p>
<p><a href="http://en.wikipedia.org/wiki/Adaptive_Replacement_Cache" rel="nofollow">http://en.wikipedia.org/wiki/Adaptive_Replacement_Cache</a></p>
<p>Caveat: This may or may not be under patent by IBM, beware of putting it in production code. I implemented it as an experiment, and since I'm in Europe I do not believe a software patent can apply to anything I write.</p>