Tech4Him – Technology with Integrity

A Christian technology chaos wrangler and his thoughts

Archive for July, 2009

SQL Log Rescue – Undo for SQL Server

Posted by Tom On July - 31 - 2009

SQL Log Rescue – Undo for SQL Server.

Came across this product again today to help with a particular need. I’ve used Red Gate products before at another employer and loved them. However, I never realized the SQL LogRescue product. On top of that, it is a free tool. Read the rest of this entry »

Popularity: 4% [?]

Developer Blog » Check if external image exists

Posted by Tom On July - 16 - 2009

Maria Birnbaum
Photo by bas:il
So, we have a website that displays images from an external source based upon a URL. For various reasons, sometimes the external source does not have a valid image for the request. In order not to show a broken image to the use, we need to validate that the image is valid.

Thanks to Google (NOT Bing. haha) we found a great little approach that was quickly placed into a Drupal template file.


if (@GetImageSize("http://www.testdomain.com/testimage.gif")) {
  echo "image exists";
} else {
  echo "image does not exist";
}

And according to the site, if you do not have GD installed you can try this code:

if (@fclose(@fopen("http://www.testdomain.com/testimage.gif", "r"))) {
  echo "image exists";
} else {
  echo "image does not exist";
}

We took the concept of the GetImageSize function to handily render web thumb shots from an external service, only if a valid image exists. This way we don’t show broken images to those Internet Explorer users.

via Developer Blog » Check if external image exists.

Popularity: 4% [?]

Data validation for datetime parameters in SSRS

Posted by Tom On July - 6 - 2009

Data validation for datetime parameter in SSRS.

Came across this piece of code for ensuring the end date comes after the start date.  Just what I was about to write but a quick Google search saved a bit of time. Yay! Read the rest of this entry »

Popularity: 15% [?]