Firefox still tends to be a bit of a memory hog over an extended period of time, even though the latest major version (3) has made massive memory usage improvements over previous versions.
This tweak will make sure Firefox behaves more like standard Windows applications when it comes to being minimized, as in freeing up the memory it’s using for Windows. The down-side to this is that when restored or maximized again, there will be a delay as the application shifts chunks from slow virtual memory to system memory.
A few months ago I posted a little query about finding duplicate rows in a database table. I’m revisiting this because I helped out Doogie with a similar query last night but with some complications.
Let’s start with the original simple scenario of checking duplicates in a single column.
Some example data, a Users table:
+----+----------------+ | Id | Email | +----+----------------+ | 1 | joe@bloggs.com | | 2 | joe@bloggs.com | | 3 | joe@bloggs.com | | 4 | jane@doe.com | | 5 | jane@doe.com | | 6 | john@doe.com | +----+----------------+
You can see that joe@bloggs.com and jane@doe.com have been duplicated. This could have been prevented by putting a unique index on the Email column.
So to find what emails have duplicates in our table:
Tags: column, columns, duplicate, duplicated, duplicates, mysql, sql, table
Land for Bags, of course!
Tags: bag, billy t, land for bags, pinch, skit
How cool is this poster? (Click for full size)
Tags: adidas, all blacks, of this earth, poster, Rugby
Most thumbnail-generation solutions will shrink the original down while maintaining aspect ratio.
Usually you specify the maximum height and width of the thumbnail, e.g. 150 x 200.
However, if your original image’s aspect ratio is different to the maximum thumbnail dimensions, you will end up with dead space vertically or horizontally (shown in green in the illustration). This can be quite an eyesore when displaying thumbnails in a grid.

I’ve got an algorithm that will automatically crop the image either horizontally or vertically to then match the thumbnail aspect ratio, so you end up with the thumbnails all being the same size even though they may be coming from originals of wildly different aspect ratio.
In the illustration, you can see that the image is scaled down and fills all the available thumbnail space, showing the parts in grey from the original that were cropped out.

The algorithm does the cropping before the resizing. It takes the width and height of the original image, and the width and height of the desired thumbnail. It will return the width and height that the original must be cropped to, to match the aspect ratio of the thumbnail. (more…)