Popular recipes by Dinu Gherman http://code.activestate.com/recipes/users/124101/2004-07-09T23:43:27-07:00ActiveState Code RecipesCounting pages of PDF documents on Mac OS X. (Python) 2004-07-09T23:43:27-07:00Dinu Ghermanhttp://code.activestate.com/recipes/users/124101/http://code.activestate.com/recipes/286219-counting-pages-of-pdf-documents-on-mac-os-x/ <p style="color: grey"> Python recipe 286219 by <a href="/recipes/users/124101/">Dinu Gherman</a> (<a href="/recipes/tags/files/">files</a>). </p> <p>Given that PDF is a "native" data format on Mac OS X, it is very easy to get access to some properties of such documents. One is the number of pages. Using Python the necessary code to do this is only about four lines, plus some import and command-line plumbing, etc.</p> Convert PDF to TIFF on Mac OS X (Python) 2003-09-17T05:37:12-07:00Dinu Ghermanhttp://code.activestate.com/recipes/users/124101/http://code.activestate.com/recipes/223320-convert-pdf-to-tiff-on-mac-os-x/ <p style="color: grey"> Python recipe 223320 by <a href="/recipes/users/124101/">Dinu Gherman</a> (<a href="/recipes/tags/graphics/">graphics</a>). </p> <p>This is a very short code snippet illustrating how to convert individual pages of PDF documents to TIFF files, one TIFF file per page. It works only on Mac OS X with PyObjC installed. As a recipe the code is compact and does not check for many error conditions, etc. The more extended version does so and can also be used as a command-line tool.</p> frange(), a range function with float increments (Python) 2001-08-07T05:00:48-07:00Dinu Ghermanhttp://code.activestate.com/recipes/users/124101/http://code.activestate.com/recipes/66472-frange-a-range-function-with-float-increments/ <p style="color: grey"> Python recipe 66472 by <a href="/recipes/users/124101/">Dinu Gherman</a> (<a href="/recipes/tags/shortcuts/">shortcuts</a>). </p> <p>Sadly missing in the Python standard library, this function allows to use ranges, just as the built-in function range(), but with float arguments.</p> <p>All thoretic restrictions apply, but in practice this is more useful than in theory.</p> Finding the convex hull of a set of 2D points (Python) 2001-08-17T00:50:23-07:00Dinu Ghermanhttp://code.activestate.com/recipes/users/124101/http://code.activestate.com/recipes/66527-finding-the-convex-hull-of-a-set-of-2d-points/ <p style="color: grey"> Python recipe 66527 by <a href="/recipes/users/124101/">Dinu Gherman</a> (<a href="/recipes/tags/algorithms/">algorithms</a>). </p> <p>This simple code calculates the convex hull of a set of 2D points and generates EPS files to visualise them. The algorithm was taken from a textbook on Computional Geometry.</p> Null Object Design Pattern (Python) 2001-09-07T00:14:12-07:00Dinu Ghermanhttp://code.activestate.com/recipes/users/124101/http://code.activestate.com/recipes/68205-null-object-design-pattern/ <p style="color: grey"> Python recipe 68205 by <a href="/recipes/users/124101/">Dinu Gherman</a> (<a href="/recipes/tags/oop/">oop</a>). </p> <p>Null objects are intended to provide first-class citizens as a replacement for the primitive value None. Using them you can avoid conditional statements in your code and express algorithms with less checking for special values.</p>