My own collection of bits and pieces designed or gathered from various sources and available for you to enjoy! Includes:
Simple component to add a right-click entry to Windows Explorer to that you can add "Process with My Application" to the list of available options.
Component to help with traversing directory structures. Will notify the owner when file or directory is found. Allows you to automate scanning a directory tree with one simple call. This is for Delphi 4 and 5, but the same source code also works on Delphi 7.
Least-squares is a way of approximating a set of data points by an equation, allowing you to predict intermediate values or calculate some measure of the data. You may have approximated a trend-line by drawing a straight line through a number of data points plotted on a graph. Least-squares does just this "fitting" but in a mathematical way that minimises the errors that result. My unit extends least-squares from just a straight-line fit into higher order polynomials for more complex data (where there may be a physical reason for a square-law fit, for example) or for a better match to the data.
Within my HRPT Reader, I had a need for a curve fitting routine that could handle a higher order fit than a simple straight-line or parabolic curve fit, and that could handle an arbitrary number of data points. I found a version of Allen Miller's Curve Fitting routine (from: the book "Pascal Programs For Scientists And Engineers", which had been typed and submitted to MTPUG in Oct. 1982 by Juergen Loewner, and corrected and adapted for Turbo Pascal by Jeff Weiss. I have updated these routines to work with Delphi 4 and 5's open array parameters. which allows the routine to be generalised so that it is no longer hard-coded to make a specific order of best fit or work with a specific number of points, and this same code works unaltered in Delphi versions up to Delphi 2009 (Delphi 2010 should be OK as well, but I don't have it to test). There is a note included on using this unit with Delphi XE2.
This code is now part of the JEDI Math Library.
Richard Kavanagh (firstname.lastname@example.org) kindly supplied a C++ version which is included in the archive as PolyFitC++.zip. Mats Webjörn contributed a note about using the C/C++ version with Delphi XE2. Tony Foale (http://www.tonyfoale.com) supplied a special version where the fit is optionally required to have zero values (including slope and derivatives) at the origin. See the file: TonyFoale.zip. Carl Lira triggered an accuracy issue which was resolved using Extended real types.
I have described how I rebuilt the LNPG library from public source code using Borland's free C++ compiler, and provided Delphi interface units in this Zip archive. You can download the DLL for using these units from this page. You need the newer, Pentium-optimised lpng-px.zip.
Like me, you may have encountered problems when trying to write JPEG images between one and two megabytes in size. You can avoid these problems by using the Intel JPEG Library, and possibly gain a speed advantage as well. I've written this simple unit as a way of loading BMPs from JPEG files, and saving BMPs to JPEG files with the minimum of fuss. Following requests, I have now updated it to read the half, quarter and one eighth size scaling that are easy to do with JPEG images. Left just for historic interest, as the Intel Library has been withdrawn. November 2009, added extra code for GetJpegSize and GetOptimumScale from Rob Spijkerman.
Delphi 3 Components & Delphi 2009 updates
These components were offered as part of my previous Delphi 3 applications. You may require some of these components should you wish to rebuild those earlier applications. You must E-mail me for any source code for rebuilding the current Delphi 4 or 5 applications. The library includes the items below, plus a few other goodies such as an LED:
The PieChart component has been modified by Tony Maro for use with FreePascal under Linux, and is available from Tony's site.