Popular recipes tagged "meta:license=mpl" but not "macro"http://code.activestate.com/recipes/tags/meta:license=mpl-macro/2012-04-30T21:43:00-07:00ActiveState Code RecipesFind a unique name based on prefix + digit in log2(n) + log2(n/2) (Python)
2011-10-31T20:30:54-07:00Garel Alexhttp://code.activestate.com/recipes/users/2757636/http://code.activestate.com/recipes/577934-find-a-unique-name-based-on-prefix-digit-in-log2n-/
<p style="color: grey">
Python
recipe 577934
by <a href="/recipes/users/2757636/">Garel Alex</a>
(<a href="/recipes/tags/name/">name</a>, <a href="/recipes/tags/unique/">unique</a>).
</p>
<p>Find a unique name based on a prefix for a content in a container
(eg. a file in a directory) adding a digit to the name</p>
<p>Does it in log2(n) + log2(n/2) were n is the number of duplicates</p>
<p>This would be used eg. in a CMS giving identifiers based on content title, or when shortening file names on a file system, etc.</p>
Perl Script to obtain data file in a desired format (Perl)
2011-02-19T23:18:01-08:00ilon asolothttp://code.activestate.com/recipes/users/4177080/http://code.activestate.com/recipes/577582-perl-script-to-obtain-data-file-in-a-desired-forma/
<p style="color: grey">
Perl
recipe 577582
by <a href="/recipes/users/4177080/">ilon asolot</a>
.
</p>
<p>This discusses about using Perl, how we can obtain a data file in a particular desired format, given a data file in a random format. By format, we refer to the order of columns in the input data file. Using this Perl script, we obtain output data file in a particular format and we get another file having discarded data lines, based on some filtering condition.</p>
Hash text simply (PHP)
2012-04-30T21:43:00-07:00Xavier L.http://code.activestate.com/recipes/users/4171602/http://code.activestate.com/recipes/576893-hash-text-simply/
<p style="color: grey">
PHP
recipe 576893
by <a href="/recipes/users/4171602/">Xavier L.</a>
(<a href="/recipes/tags/crypt/">crypt</a>, <a href="/recipes/tags/extensible/">extensible</a>, <a href="/recipes/tags/generator/">generator</a>, <a href="/recipes/tags/hash/">hash</a>, <a href="/recipes/tags/php/">php</a>, <a href="/recipes/tags/secure/">secure</a>, <a href="/recipes/tags/security/">security</a>, <a href="/recipes/tags/simple/">simple</a>).
Revision 5.
</p>
<p>This is a simply and extensible script that can be used to rapidly has any amount of text using PHP's hash() built-in function.</p>
<p>It recognizes when the page is loaded for the first time and displays a form with options. Afterward, it display the selected hash(es), with a link at the bottom to start again.</p>