Popular recipes tagged "compare" but not "list"http://code.activestate.com/recipes/tags/compare-list/2017-04-08T16:40:25-07:00ActiveState Code RecipesRecursive fc/diff for Windows, optionally copy missing/different files (Tcl) 2017-04-08T16:40:25-07:00John Brearleyhttp://code.activestate.com/recipes/users/4184423/http://code.activestate.com/recipes/580776-recursive-fcdiff-for-windows-optionally-copy-missi/ <p style="color: grey"> Tcl recipe 580776 by <a href="/recipes/users/4184423/">John Brearley</a> (<a href="/recipes/tags/compare/">compare</a>, <a href="/recipes/tags/file/">file</a>, <a href="/recipes/tags/tcl/">tcl</a>). </p> <p>Utility to add recursive capability to fc.exe on Windows. Will optionally copy/update missing or older files as needed. If you have a diff.exe in your path, say from having installed TkDiff utility, the diff.exe will be used as the prirmary compare tool, with fc.exe as the backup tool.</p> Dependency resolution (Python) 2016-04-14T12:58:40-07:00Mike 'Fuzzy' Partinhttp://code.activestate.com/recipes/users/4179778/http://code.activestate.com/recipes/580642-dependency-resolution/ <p style="color: grey"> Python recipe 580642 by <a href="/recipes/users/4179778/">Mike 'Fuzzy' Partin</a> (<a href="/recipes/tags/compare/">compare</a>, <a href="/recipes/tags/dependency/">dependency</a>, <a href="/recipes/tags/sort/">sort</a>, <a href="/recipes/tags/sorting/">sorting</a>). </p> <p>This recipe shows how to take a list of objects, each with their own list of dependencies, and resolve them to proper order. It includes some poor mans circular dependency detection (very poor mans).</p> Comparing two images (Python) 2011-04-03T11:13:24-07:00Charlie Clarkhttp://code.activestate.com/recipes/users/4171013/http://code.activestate.com/recipes/577630-comparing-two-images/ <p style="color: grey"> Python recipe 577630 by <a href="/recipes/users/4171013/">Charlie Clark</a> (<a href="/recipes/tags/compare/">compare</a>, <a href="/recipes/tags/images/">images</a>). </p> <p>Compare two images using the root mean squared analysis. A result close to 0 means a good match.</p> Compare CSV Inventory files (Python) 2009-08-18T14:14:04-07:00Mike Burkehttp://code.activestate.com/recipes/users/4171487/http://code.activestate.com/recipes/576885-compare-csv-inventory-files/ <p style="color: grey"> Python recipe 576885 by <a href="/recipes/users/4171487/">Mike Burke</a> (<a href="/recipes/tags/compare/">compare</a>, <a href="/recipes/tags/csv/">csv</a>). </p> <p>Program will compare two CSV files using a unique ID field and save any changes to ID as well as two secondary fields (qty &amp; price). The code was written to pick out updates from supplier inventory files.</p> Compare MySQL DB (Python) 2016-02-11T17:31:39-08:00Jice Clavierhttp://code.activestate.com/recipes/users/4089467/http://code.activestate.com/recipes/576589-compare-mysql-db/ <p style="color: grey"> Python recipe 576589 by <a href="/recipes/users/4089467/">Jice Clavier</a> (<a href="/recipes/tags/compare/">compare</a>, <a href="/recipes/tags/comparison/">comparison</a>, <a href="/recipes/tags/database/">database</a>, <a href="/recipes/tags/mysql/">mysql</a>). Revision 3. </p> <p>Small module to and check for differences between 2 DB.</p> <p>It will compare the table list, the tables structure and their content.</p> <p>When you run the program, you are ask if you want a detailed comparison. As global comparison will list all the different tables, detailed comparison will output every different record (and will take longer to run)</p> compare(), making filter() fun again (Python) 2008-10-04T12:40:42-07:00Andreas Nilssonhttp://code.activestate.com/recipes/users/4167183/http://code.activestate.com/recipes/576526-compare-making-filter-fun-again/ <p style="color: grey"> Python recipe 576526 by <a href="/recipes/users/4167183/">Andreas Nilsson</a> (<a href="/recipes/tags/compare/">compare</a>, <a href="/recipes/tags/filter/">filter</a>, <a href="/recipes/tags/functional/">functional</a>, <a href="/recipes/tags/lambda/">lambda</a>). Revision 2. </p> <p>compare() takes a function parameter and returns a callable comparator when compared to a value. When called, the comparator returns result of comparing the result of calling the function and the value it was created with.</p> <p>Basic usage:</p> <pre class="prettyprint"><code>items = [1, 2, 3, 4, 5] def double(x): return x * 2 for i in filter(compare(double) &gt; 5, items): print i #Prints 3, 4 and 5 </code></pre> get index of element in list using identity (Python) 2008-08-16T19:41:37-07:00nosklohttp://code.activestate.com/recipes/users/4166478/http://code.activestate.com/recipes/576426-get-index-of-element-in-list-using-identity/ <p style="color: grey"> Python recipe 576426 by <a href="/recipes/users/4166478/">nosklo</a> (<a href="/recipes/tags/compare/">compare</a>, <a href="/recipes/tags/comparision/">comparision</a>, <a href="/recipes/tags/find/">find</a>, <a href="/recipes/tags/identity/">identity</a>, <a href="/recipes/tags/index/">index</a>, <a href="/recipes/tags/is/">is</a>, <a href="/recipes/tags/same_object/">same_object</a>, <a href="/recipes/tags/search/">search</a>). Revision 2. </p> <p>my_list.index(element) returns the index of the element using common comparision (as in == or __eq__() or __cmp__()). If you need to find an element on the list using identity comparing (is) then this function can do it for you</p>