INCLUDE_DATA

Archive for July, 2009

Dynamically re-size an iFrame’s height across browsers

July 8th, 2009

A while back I had a need to dynamically re-size an iFrame’s height and found a solution using a jQuery plug-in called autoHeight.  What I later found was that this solution provided poor results with Internet explorer when my iFrame’s contents were fairly large and frequently changing (i.e. via navigation inside the iFrame).

It took quite a bit of tinkering but I was able to come up with a solution that works (and works well) in IE, Firefox, Safari and Chrome.  It still uses jQuery but doesn’t depend on a plug-in.  Here’s the code in case you’re looking for the same thing:

First, the iFrame…

<iframe src="Page1.htm" id="MyFrame" 
frameborder="0" marginheight="0" marginwidth="0" 
width="800px" height="100px" scrolling="no"></iframe>

Next, the JavaScript to resize it…

<script type="text/javascript">
 
     function sizeFrame() {
          jQuery("#MyFrame", top.document).css({ height: 0 });
          var heightDiv = jQuery("#MyFrame", top.document).contents().find('body').attr('scrollHeight');
          jQuery("#MyFrame", top.document).css({ height: heightDiv });
     }
 
     jQuery(function() {
          sizeFrame();
          jQuery("#MyFrame").load(sizeFrame);            
     });
 
</script>

This line is needed to initially initialize the height so that it works in Safari and Chrome. Without this line the window will never shrink to fit smaller content, it will just retain the last biggest height.

jQuery("#MyFrame", top.document).css({ height: 0 });

Visual Studio 2008 is a piece of shit!

July 3rd, 2009

It’s been one of those weeks :(

visual-studio-wait

It should be noted that I was able to take a screen shot, upload it to Wordpress and make this blog post before that message went away and I was able to interact with Visual Studio.NET again!

July 2009 Baltimore SQL Server Users Group Meeting

July 2nd, 2009

Passing along the Baltimore SQL Server Users Group July 2009 Meeting Announcement.  I’m considering attending since we use Reporting Services and SQL Server 2008 here at work.  Here’s the information in case you may be interested in attending.  Don’t forget to RSVP via email as noted below.

General Meeting Information

Presentation Information

  • Title: SQL Server Reporting Services Report Builder 2.0
  • Speaker: Craig Guyer of Microsoft
  • Abstract: Authoring reports for SQL Server Reporting Services is even easier than before using the new stand-alone application Report Builder 2.0 (RB2). In this session we will walk through creating some basic reports, show how RB2 fits in with other report authoring applications, and discuss other new report authoring features in SQL Server 2008.

Don’t pay those shipping fees!

July 2nd, 2009

I buy tons of stuff from Amazon.com.  It’s convenient, the prices are usually pretty good, and most of the time you can usually get free shipping if you spend over $25 thanks to their super saving shipping (which, all though they say is the slowest method I usually get stuff in 2 days anyway).

Well, what happens if the thing you want is $18.50?  What about if it’s $22.53?  You only need another $2.47 to get free shipping (which may cost you 3x that much).  There must be a way you can get that free shipping without adding another $30 thing to your order that you didn’t need…

super-saver-shipping

Enter item fillers.  These websites are great because they let you search by a specific amount you need in order to qualify for free shipping.  Just load up the site, put in your amount, pick some categories that you may want to look in and optionally put in a search keyword and viola… you have pages of items that are close to that $2.47 that you needed to spend in order to get free shipping!

Two sites that I found recently were SlickFillers.net and FillerItem.com.  The first site is the one that I actually used earlier in the week when I was buying some stuff (see screen shot above).  I liked that site better because it showed information about most discounted items and top sellers.  I guess for me I wanted to try to get something that normally costs much more than the $7.44 that I was spending :)

So next time you’re shopping for something cheap at Amazon and you’re just shy of getting that free shipping, don’t forget about these item fillers.  You can also quickly Google amazon item fillers and you’ll find these two sites right up there at the top.

Dusting off the running shoes

July 1st, 2009

Thanks to a co-worker I’ve been slowly getting back into running lately.  For some reason (maybe having the kids?) I went from running a decent amount a few years ago to not running at all.  Not that having kids is a good reason to stop running and exercising, I guess I just let it become an excuse.  Either way, I’ve been much more active this year and for a good while now have been playing racquetball 4+ times a week.  Luckily now that I’ve gotten back into running I’m realizing that all that racquetball has gotten me in decent condition to get back into running starting out with 3+ mile runs without much trouble.

Along with dusting off my running shoes I’ve dusted off and charged back up the Garmin Forerunner.  What the heck is that you ask?  It’s a wrist-mounted GPS fitness computer!  Come on, you didn’t think I’d have a gadget for running?  You must not read this site or know me.  Actually, if you’re into running or thinking of getting into running you may want to consider picking up this or one of their other models.  It’s great when you’re trying to train for a race (5-k, 10-k, half or full marathon, etc) or just want to track your routs/progress and allows you to download your data for free to the Garmin Connect website.

Two things to note if you already have one of these devices or consider buying this model.  1, they have a firmware (software) update for the unit.  Since I hadn’t used mine in a few years mine was a few versions behind.  All you need for this is to download their web updater software and it’s pretty much automatic from there.  2, this unit only has a serial (RS-232) interface to the computer.  If you don’t know what that means all you need to know is that most new laptops and Macs don’t have serial interfaces.  You can solve this problem by picking up a USB to Serial cable adapter.  This will make working with any modern computers (laptops and Macs) much easier and faster.

Hopefully I can stick with the running now and build back up to doing some races.  My co-worker is doing the Virginia Beach Half-Marathon this Labor Day weekend.  I would love to go with him but we have so much else going on this summer that I really just can’t take another weekend away.  I may be able to convince him to do the Baltimore Half-Marathon this October.  We’ll have to see how that works out I guess.

Either way I plan on getting in at least 2 runs a week for now as I ease back into things.30