Author Archives: bill

Apple Airport Extreme Base Station

I’ve been going through wireless agony lately. First, my trusty Linksys WRT54G wireless router bought the farm. It had lasted quite a while, probably at least 5 years. I think it should have lasted longer, but my fooling around with its firmware probably didn’t help it out much. So when it died, I went out to buy a new one.

Against my better judgment, I went with a Netgear instead of another Linksys. The price and features were a little better, so I said what the heck. Big mistake. While it works great if you’re connected via an ethernet cable (it’d be really bad if it didn’t), the wireless is just crap. Even with my laptop no more than 5 feet away, the wireless signal, though strong, doesn’t give a reliable internet connection. Yeah, its wireless and it won’t be as fast as loading when connected directly, but waiting a minute or so for a page to load is just crazy. So I’d had it. Time to return it. But what to get?

I was in the Apple Store getting my new Mag Safe adapter (and OS X Snow Leopard) and I decided to give their Airport Extreme Base Station a go. It was sort of a cross between an impulse purchase and the desire to get reliable wireless back again. Boy am I glad I bought it. Install was a snap with their Airport Utility. The internet is served up like it was when I was plugged in to my old router and the POS Netgear I tried out. I’ve read some reviews where people don’t like this thing, but I don’t know why. Maybe they just don’t know how to use it or wanted something different. This puppy is it for me. I’ll never go back!

First Impressions of Mac OS X “Snow Leopard”

Snow Leopard came out on Friday (8/28) and since I had to go to the Apple Store to pick up a new Mag Safe power adapter for my MacBook Pro, I figured I’d pick up a copy of the OS X upgrade. At only $29, it was pretty hard to pass up.

The install went fairly smoothly, even though it took about an hour for it to finish. I found that a little long, but my MacBook Pro is fairly old to today’s standards. Apple boasts some great new features like speed, 64-bit and 32-bit support, faster boot times, freeing up hard disk space, and other great refinements to make an already easy to use system, even easier. So I installed it and gave it a spin.

As far as faster boot times, after it was done installing, I’d say the boot time was rather slow. I’m not sure if it was doing some post install stuff, but I wasn’t impressed. So I gave it another reboot to see if that was the case. It was. My MacBook went down and came right back up like an acclaimed prize fighter should. Definitely snappier than it was with OS X 10.5.

So now I’m up and running, and my first impression is whoa! Its almost like I have a new MacBook Pro. Boot up is fast, starting applications is fast, Finder is super fast! Finder being faster was most impressive. Typically opening the Applications folder was a chore. I’m not sure what it was doing, but it was slow as heck. Not anymore. I haven’t even started using any of the new features they’re boasting about and its already paying off. The fact that I feel like I have a new system is totally worth the $29.

Why is Safari 4.0 Crashing On Me?

I tell everyone I meet who asks about my MacBook that I love it. Sure I’ve had some problems with the hardware replacing the fans, but other than that, nothing. The Software, OS X, Safari, and every other app I generally use on the Mac are stellar. I have never really had an issue, until now.

I typically use Safari for my browsing needs. Firefox always seems sluggish and continues to be a memory hog (probably more due to the extensions I have installed than anything else). I just use it for the moderate amount of web development I do. So for the most part, I stick with Safari. However lately, I have noticed that it crashes quite often on me. I might have a handful of tabs open with GMail, Facebook, ESPN, and a few other pages going, but nothing crazy. That little annoying colored pinwheel pops up and then blam! Safari crashes, asking me to report a problem.

I don’t remember this happening this often, if at all, with Safari 3.x. What has Apple changed? I’m hoping that Snow Leopard and any updates there might right the ship. But I won’t hold my breath. Is anyone else out there having similar issues with Safari 4.0?

Dear ESPN: You’re Annoying Me Again

As if the auto-playing video on ESPN.com wasn’t bad enough, they’re going crazy with their ads now. I just went to go check the MLB scores and before I can get to the page, this big hover window with an ad for Madden ’10 comes up. Ok, not that big a deal. There’s a button with an X on it to skip the ad. I click it. I click it again. I click it a third time. Nothing. So I’m forced to watch this damn ad for a video game that I have no interest in. If that wasn’t bad enough, another ad pops up over the next article I go to read. Now, I understand that they need to make money. No problem. But if you’re going to allow people to skip ads, make sure it works. Some of us just want to use your site and enjoy the content without being harassed all the time.

Create PDF Documents in C# on the Fly with PdfSharp

Recently I was doing a freelance project and had to find a way to create PDF documents on the fly in a C# application. I figured the best approach would be to create PDF files that could be printed, then archived for retrieval at a later date. There are definitely libraries out there that you can pay for to help with this, but I really wanted something that was OpenSource. Luckily, I found PdfSharp!

You can pretty much draw anything for your PDF document using PdfSharp, shapes, text, images, etc. and you have full control over the fonts and the font weight. This gives you a lot of flexibility in creating your custom PDF documents. I highly recommend checking it out if you’re looking for a cheap (free is the best!) solution for your document creation.

Selling Stuff With a Blog and Google

About 2 years ago, my mom started cleaning out her house of stuff that she no longer needed to keep around. It meant a lot of work tossing plain old junk we didn’t need and selling stuff that we could get some money for. That meant some posting of items on eBay and Craigslist. It was also around the time I started blogging more and I decided that I would dedicate a page to some of the items we were trying to sell on Craigslist. This also included two windsurfers that hadn’t been used in probably a decade.

We were able to sell a majority of our stuff on Craigslist and having stuff linked to my blog from the various CL posts helped to move more stuff. However, the windsurfers failed to sell. Until recently. I received an email from a gentleman that lives in NY who was interested in the Fanatic Lite Viper we were selling. I’d get anywhere from 10-25 visits a month related to that particular windsurfer and I think this guy was one of them. A long story short, he ended up making the trip to NY to my mom’s house in RI to buy the board and all of the sails and accessories we were offering with it. Even better, he asked the price we wanted and it went to a home where it’d finally see some use again.

Even though it took 2 years to sell the board, it just shows that if you put some information out on the web, you can reach the people you need to reach eventually. And hey, even help some some unused stuff you have lying around too!

Dear ESPN.com: Please Disable Auto Playing of Video

This annoyance goes right up there with sites that play music when you visit them. ESPN, for Pete’s sake, stop having your stupid video’s auto play when I load one of the pages on ESPN.com. I don’t care to hear them. I don’t care to watch them. I watch SportsCenter, Baseball Tonight, and all of the other shows to know what’s going on in the sports world. I don’t need to see it again. Plus, I’m probably already watching TV or listening to music. Or even still, maybe my wife is sleeping next in the same room while I’m on my laptop and the video just blared without my control and woke her up. I realize you’re trying to “enhance” the quality of your site, but its downright pissing me off.

Google Site Rankings Related to site: Results

I had a revelation recently about the Google rankings for one of my sites lately. I’ve actually been frustrated with the lack of and drop in ranking for important keywords we used to rank well for. I think its pretty clear that Google’s index changes fairly often, but I would never expect rankings for keywords to drop completely. Hours and hours of research and I found nothing obvious about where I could have gone wrong.

For a completely random reason, I decided to see what site: returned for the pages index from my site. I noticed that our index page wasn’t the first result returned. I found that odd. Every other site I manage it is the case what the index page is the first result. So it got me to thinking, since your index page is the most important page on your site, could having it not be #1 for a site: search be related to a drop in rankings for important keywords?

I started tracking our appearance in Google for our important keywords related to when our index page was #1 in the results from a site: search and guess what? It turns out that, for us anyway, there is a direct correlation to our ranking for our important keywords to the index page not being #1 for a site: search for our domain.

That got me to thinking again though, why isn’t the index page number one? Well, my guess is that about the time that it goes missing, we’ve had some issues with access to pages on our site. Either having the site down for maintenance for an extended period of time or during a period when we were changing servers, Google couldn’t access our index page and hence, we’ve taken a penalty. This definitely has me thinking of other ways to bring our dynamic site down for updates, but not having the site down completely, especially the index page. Its quite apparent that Google takes the reliability of a site very seriously these days.

Does anyone have any further insight or experience with similar behavior?

Remove ViewState From ASP.NET Page to Improve Performance

In a previous post, I eluded to the fact that I remove the ViewState from our ASP.NET pages to improve performance. I can’t take credit for coming up with the idea though. Originally, I got the idea and solution I wanted to implement by reading this article at EggHead Cafe. The solution I chose was to store the ViewState on the web server’s file system and reference the file in the page sent back to the client. I’ll outline how I did that below.

The first thing you’ll want to do is create a new Page base class that inherits from System.Web.UI.Page so you can override some of its methods, namely SavePageStateToPersistenceMedium and LoadPageStateFromPersistenceMedium. This will allow you to save the page’s ViewState to the file system and then re-load it on a post back. Let’s start with saving the ViewState to the file system.

protected override void protectedSavePageStateToPersistenceMedium(object viewState)
{
	// Serialize the view state into a base-64 encoded string
        LosFormatter los = new LosFormatter();
	StringWriter writer = new StringWriter();
	los.Serialize(writer, viewState);

	string guid = NewGuid();
	string vsp = ViewStateFilePath(guid);

	// Save the string to disk
	StreamWriter sw = File.CreateText(vsp);
	sw.Write(writer.ToString());
	sw.Close();

	// Save the guid in a form field
	ClientScript.RegisterHiddenField("__VIEWSTATE_GUID", guid);
}

So, let’s step through what we’re doing here. The first few lines of code, we’re serializing the view state. Next, where we call

string uid = NewGuid();

We’re creating a new guid that we will use in creating the file name on the server for the actual value of the current view state. NewGuid() just returns a new guid value from the System.Guid class.

Next, we need to create a path to where we’re going to store the file as well as its file name. Now, you can do this any way you want as long as all of your files end up being unique. You can’t go overwriting one guy’s view state with someone else’s. Now I based mine on basically the guid appended with the current request path minus the extension and replacing the slashes with dashes. So, my filename looks like:

string fileName = guid + "-" + Path.GetFileNameWithoutExtension(Request.Path).Replace(
    "/", "-") + ".vs";

Where the guid was passed in to the function that I called to create the view state file path.

So now that we have a path to where we can write the file, we can go ahead and do so using the StreamWriter that we created. Now, the last thing to do is spit out where we can find the view state to the client. This is done by registering a hidden field with the client:

ClientScript.RegisterHiddenField("__VIEWSTATE_GUID", guid);

That GUID allows you to recall the proper file for the client when you need to access the ViewState.

So now you’ve persisted the view state to the file system. Now all that’s left is to load it up when needed, which is done with LoadPageStateFromPersistenceMedium(), which is below.

protected override object LoadPageStateFromPersistenceMedium()
{
	string guid = Request.Form["__VIEWSTATE_GUID"];
	if (guid == "")
		return null;
		// determine the file to access
	if (!File.Exists(ViewStateFilePath(guid)))
	{
		return null;
	}
	else
	{
		// open the file
		StreamReader sr = File.OpenText(ViewStateFilePath(guid));
		string viewStateString = sr.ReadToEnd();
		sr.Close();
		// deserialize the string
		LosFormatter los = new LosFormatter();
		return los.Deserialize(viewStateString);
	}
}

This approach gives you the ability to minimize the amount of data that you have to send over the wire to a client browser. There are other solutions to this like storing the ViewState in memory, but I felt that it was a waste of resources if a ViewState might only be used once and then abandoned. The one thing you’ll want to do is manage your saved ViewState files on your disk. These files can get out of control, especially when you get a lot of visitor’s. So what I did was just set up a Scheduled Task in Windows to clean up stored ViewState’s every three hours. This works out pretty good since a ViewState really won’t be needed beyond that timeframe.

Anyway, I hope this solution helps some other C# ASP.NET developers out there. It sure worked out great for me!

MacBook Pro Hard Drive Upgraded to Seagate Momentus 320GB 7200rpm

I’m on a roll the past week it seems with fixing or upgrading my MacBook. So I’ve decided to wrap things up with upgrading my internal hard drive. I’ve noticed that my MacBook is kind of sluggish lately, especially when booting. I was also running out of storage space, so it seemed like a good opportunity to upgrade my internal hard drive.

Seagate Momentus 320GB 7200pm Notebook Drive

The MacBook Pro 17″ Core Duo I have originally came with a 120GB 5400rpm Seagate Momentus. I thought this drive was a great drive in my opinion so when upgrading, I decided to go with a newer, larger Seagate Momentus. The model I chose was the 320GB, 7200rpm drive. Installation took about 20 to 30 minutes, mostly because of all of the screws you have to take out to open up the case.

Upgrading to the 7200rpm drive was definitely a good choice. While having the fast drive will probably deplete my battery quicker, I thought having it was worth it to have faster boot times and faster disk access times. The 320GB should provide all of the space I need for quite some time.

Oh, and I didn’t discard my old drive. I spent another $40 and bought a Firewire/USB 2.0 enclosure, so now I can bring my old drive with me on the road and use it to store bigger files and back up my data.