Archive for September, 2007

I LOVE Quality of Service (QoS)

I’m got my new Linksys WRT54GL router all set up. Most of the features are fairly typical, therefore not very exciting. However, the QoS (quality of service) features have a significant impact on my Internet experience. It’s basically a prioritization algorithm that can make sure that higher priority traffic gets through at the expense of lower priority traffic.

Last night, I started an rsync backup on my Linux server. It quickly sucked up 120KB/s of my upload bandwidth. I configured QoS to assign the rsync port the lowest possible priority. That means that any other traffic should slow it down. BitTorrent traffic is in the same category. While the backup was running, I started a BitTorrent download. I watched the rsync speed drop, until the BitTorrent speed and rsync speed were about even.

Then, I opened Unreal Tournament 2004 before setting it up for QoS. The ping times were between 200ms and 300ms, and it was nearly unplayable. I quit the game and prioritized the ports (7777-7788) to the highest level. After re-opening the game, my ping times were around 20ms, and it was perfectly smooth.

After I quit the game again, I tried shutting down æTorrent and then watched rsync get all of the bandwidth back.

This is great because I used to start my backups late and night, and then kill them in the morning. The problem is that there were often hours of wasted time that files could have been synchronizing, but I didn’t want it interfering with my connection. Now, I can let it synchronize any time it wants, and I won’t even notice a difference.

I highly recommend QoS to any Internet power users, gamers, or people using VOIP.

Technorati Tags: , , , ,

Linksys WRT54GL with aftermarket firmware

As I mentioned, my Internet connection is a little faster than what my current router supports. I currently have a Netgear FVS114 router, and a WGT624. I purchased the FVS114 router because I wanted something that was extremely stable. The typical consumer grade routers seem to have various stability problems. It’s usually easy to see because of the high frequency of firmware upgrades.

My current wireless access point is a WGT624 router, but I don’t use it as a router. it just seems to work better having the router an the WAP separate.

Well, I’ve decided to consolidate (replace) them with a Linksys WRT54GL wireless router. It runs a stripped down version of Linux by default, but that’s not even the best part. It’s an easy router to run aftermarket firmware on. That basically means I can run a completely different operating system on it, increasing stability and features.

Linksys-WRT54GL

I’ve hated Linksys for a long time, because I found a lot of their wireless routers to be very flakey. I’ve read enough reviews about this one to be confident that this is an exception to the rule.

I’ve spent a lot of time reading about DD-WRT and Tomato. Using one of these firmware’s adds a lot of stability, features, and security. You can do some cool things like boost the output power, set up advanced QoS, set up custom cron jobs, and monitor bandwidth usage. I think I’m going to give Tomato a try to see if it suits my needs. I can upgrade to DD-WRT if I need some specific features, but I have a feeling that it will be more “bloated” for my tastes.

I’m specifically interested in boosting the output power so that I get a little bit better signal in my house. My access point is on on one end of the house in the basement, so the signal isn’t as good as it could be in parts of the house upstairs. The router also has a standard antenna connector, so I can add a better antenna if I want.

I’m also very interested in the QoS features. Basically, I’ll be able to prioritize different types of traffic. For example, I can set up my daily backups to be low priority, so that they don’t interfere if I’m using the connection for anything else. Previously, I had set up my backup script so that it would only run at night. Now, they can run all day if necessary, and only use bandwidth that would normally go unused.

You can view my latest router bookmarks at del.icio.us.

Technorati Tags: , , , ,

Road Runner TURBO! 15Mb down, 1Mb up

Not may people realized it, but Time Warner upgraded the speed of their broadband access from 5Mb/384Kb to 7Mb/512Kb. The speed isn’t significant, but at least they bumped up the pitiful upload speed. I think they keep it low for things like BitTorrent, and so that people don’t run servers from home, and it sure does kill it.

I had a tech out to my house yesterday to fix some intermittent cable modem issues. He ended up replacing the cable modem, and said the new one can go up to 15Mb/s. I found out the turbo package as they call it, is only $9.95 more than the standard plan. I called them up, and they’re even running a special. You can get the turbo speed for 12 months for only an additional $5.00. They also gave me a deal on my DVR, so I’m going to be saving money for the next 3 months.

Speedtest-NE

SpeedTest-Chicago-Il

As you can see, I took some speed readings at SpeedTest.net. I’m very impressed by the speed. The upload is actually much faster than they even claim. I was baffled by the download speed, but it turns out that even though my WAN port on my FVS114 is 10/100, it actually is only capable of passing through 11.5Mb of data to the LAN side. From what I’m reading, that’s actually a common problem now that FIOS is gaining popularity. I’m working on a plan of action to take advantage of the full 15Mb speed.

Technorati Tags: ,

Windows Vista or XP?

As I mentioned, I’m getting a new laptop. I believe it’s going to be a sweet machine with a 2.4Ghz Core 2 Duo, 4GB of RAM, and 200GB of hard drive space. I’m trying to decide if I want to use Windows XP, or Windows Vista.

At first, I was convinced that I was going to use XP. After all, it’s stable, fast, and has 2 service packs under its belt.

Then, I went to a Microsoft conference, and of course they were running Vista. It seemed to run very well for them, and even though the eye candy wasn’t that impressive, it still put XP to shame. I’ve always been one to be running the latest software, so of course I’m getting itchy. I’m also a little upset that XP will only recognize 3.5GB of RAM on the new machine. The irony is that Vista will recognize it all, but will probably eat up the extra 512MB.

I had pretty much decided to use Vista.

I went so far as to create the streamlined Vista install disk using vLite, the Vista version of nLite. It allows me to integrate all of the latest hotfixes into the installation disk, so that you don’t have to mess around with Windows update.

Then I started doing Google searches for “XP vs Vista“. I was not impressed. There are very few people that can say anything good about the OS. Combine that with the fact that many of your drivers and applications won’t work, and you have a recipe for frustration. I’m not really in the mood to be fighting with my operating system to get anything done.

The good news is that my requirements are not too crazy, since I do my software development in a virtual machine. Here is a basic list of what I need to run:

  • VMware - for my virtual development environment.
  • GAIM/Pidgen IM
  • Filezilla
  • Outlook - For exchange access
  • Thunderbird - For IMAP mail
  • SVS
  • Windows Live Writer
  • Truecrypt
  • Notepad++
  • TightVNC
  • KeePass
  • Putty
  • Firefox
  • VLCPlayer
  • Juice
  • Paint.NET
  • Wireshark
  • 7-zip
  • Unlocker
  • Picasa
  • Unreal Tournament 2004

So now, I’m not sure. What do you think I should do?

Technorati Tags: , ,

Testing invariant’s with a design by contract framework

I recently stumbled upon a formal design by contract framework for .NET. If you’re not familiar with design by contract, you can go here for a quick overview. Basically, it’s a methodology that you use when designing your methods. You have a strict definition of the inputs and outputs.

I’m working on a project right now where I’m building a layer on top of the FarPoint grid control. I’m basically creating a grid that is specifically suited to some applications that we’re working on. I’m adding a lot of features to the underlying grid, and the complexity has been going up exponentially. Every feature interacts with every other feature. For example, the grid always needs to be in a sorted state, and at the same time could be subjected to filtering, row inserts, data changes, etc. I have an extensive suite of automated unit tests, but it’s difficult to test every possible combination of features.

The framework I’m using has a method for checking invariant’s. It’s simply the concept of checking the state of your object (in this case, the grid), to make sure that it’s valid. For example, I can verify that the rows in the grid are sorted correctly. I’ve created a method that looks at the grid in almost every possible way, and determines if anything looks incorrect.

I run a full invariant check at the beginning and end of every public method. Obviously this causes a significant performance penalty. Fortunately, I can use the .NET conditional attribute to cause the invariant’s to not run when in release mode.

  1. Invariant Check
  2. Pre-condition Check
  3. Method logic
  4. Post-condition Check
  5. Invariant Check

This checking quickly found a lot of bugs, and it’s made it easy for me to locate them. Any time the grid is sorted incorrectly, an exception is thrown at the earliest possible time, so I can quickly locate the offending method. This also compounds the effectiveness of my automated unit tests. A short unit test that tests a small piece of functionality is actually testing that functionality against dozens of other assertions.

This has been a lifesaver.

I’ll keep a running list of bookmarks about design by contract here.

Technorati Tags: , ,

Microsoft Conference - Silverlight, WCF, and LINQ

I’m finally getting around to mentioning the cool stuff I saw last Tuesday. Microsoft was kind enough to visit our small town of Green Bay Wisconsin. They showed off some of the cool new development technologies coming up. As always, it was a great learning experience, and a great way to get a quick overview and demo of what they’ve been working on.

WCF

The first thing we saw was WCF, which is the Windows Communication Foundation. I was really impressed, but I thought it was going to be something more revolutionary. Instead, it looked like it was just ASP.NET webservices on steroids. By steroids, I mean security and extensive configurability. Don’t get me wrong, it’s very cool, but I don’t see myself using it anytime soon since it doesn’t really apply to any projects I’m currently working on.

LINQ

Next, we moved on to LINQ, which was what I was most excited about. Basically, it’s a really nice way of moving your database logic into your application code. We saw some neat demos, where the presenter was able to do amazing data reads with a fraction of the code that you would have needed previously.

What I didn’t like about the demos was the fact that they could give the audience the wrong idea. For most projects, I like to keep my data layer separate. Writing SQL code in the UI layer is just asking for problems. What happens when you want to reuse that query? What happens when you want to add caching?

I also starting thinking about how you would actually use it. The examples showed him populating a few fields of some objects. If you had to pass those objects to other methods, they need to know what fields have been populated. In fact, you would normally want them to assume that the object was completely populated. Imagine one method that retrieves a bank account object. It gets the customer information, but not the account balance. That object then gets passed to a method that deposits money into their account. Since the amount is 0 (it wasn’t loaded), it will add the balance to 0, and save it back to the database. You either have to start tracking this, or load everything ahead of time.

I’ve been using NHibernate a lot in my projects lately. Their approach is typically to load all fields in the object. When I start using LINQ, I intend to use it in the same way. LINQ will basically replace NHibernate and let me write a little bit less code, which means less development time, and I’m more likely to get it right the first time.

I love O/R mappers because they can have a dramatic impact on development times. They also perform surprisingly well, assuming you use them appropriately. It’s great to retrieve a set of objects, and have it it write all of the complicated joins for you, and get everything in one operation. This is certainly possible with plain old ADO.NET, but you’re going to spend a lot of time squeezing a marginal amount of performance out of it.

LINQ will be available in .NET 3.5, which should be released within the next 6 months.

Silverlight

The last topic of the day was Silverlight. Silverlight is basically an Adobe Flash replacement. I was excited that I could use managed code to build flash applications, but I’m sadly mistaken. First of all, animations are typically done inside of a product called Expression Blend. It does seem easier to use than the flash editor, but it’s still a whole new paradigm to learn for most developers. It’s typically geared at designers.

It is surprising to most that it was designed to be cross-platform, and there are going to be plug-ins available for OSX and Linux.

For driving the animations, I though that you were able to managed code (C#, VB.NET, etc). The truth is you will be able to use managed code, but not until Silverlight 1.1. Silverlight 1.0 is driven by JavaScript, which is not very appealing at this point.

I’m still struggling with the line that determines where the UI design ends, and the developer work begins. One of the Silverlight samples shows a paint swatch. Clicking on a color brings up one a bunch of those color sheets you get at the store when picking out a paint color. The animations were done in XAML, created with the Expression editor. Should the UI designer be writing those animations? What if the animations are conditional, and require code? What if you’re designer decides to write the code that drives it, but it doesn’t fit in with the code you already have? What if it’s just flat out bad code that you now have to maintain?

Bypassing Theftlock on your car stereo

I replaced the battery on my Malibu, forgetting about the Theftlock feature on my stereo. After I put in the new battery, I realized that I didn’t know my code. It’s pretty bad since this has happed to me before, and I had to figure out how to bypass it again.

Fortunately, Google makes it easy to find instructions:

  1. Press and hold presets 2 & 3 for about 10 seconds until the first 3 digits of the display code are displayed.
  2. Write the numbers down.
  3. Press the AM/FM button, write down the next 3 numbers.
  4. Call 1-800-537-5140, when asked, enter 620529, press the # button and enter the 6 digit code from the radio, you will get an unlock code, write it down.
  5. Go back to the car, press the HR button and set the first 2 numbers, then press minute button and set the next two last numbers, press AM/FM button, SEC should be displayed, turn on radio.
  6. To remove customers code, repeat step 5. you should see — on radio face, the code is now out of the radio.

I did this, and I got 502 and 509. The phone call gave me back the code of 0640. If you ever want to steal the POS factory CD player out of my car, now you know the code.

If you wander on this post too far in the future, the dealer code may have changed. You’ll have to find a new one with Google.

Technorati Tags: ,

VMware Development Environment - Up 28 days so far

Over the past year or so, I’ve been trying to minimize the number of applications that I actually have to install. I’ve been doing this in a number of ways:

  • Using portable applications whenever possible. These are applications that have been written or recompiled to store their settings in the folder that they are run from, and not the registry. This allows you to simply copy the folder to a new machine and the application will run.
  • Using SVS for applications that are infrequently used. This lets me activate and deactivate them, and they leave no trace on my system. If any SVS application is running, however, it can have a performance impact on your system. That is why I don’t use it for commonly used applications.
  • Using VMware to separate different functional areas. For example, I have a virtual machine that is running a full copy of our enterprise application.

About a month ago, I reinstalled Windows on my main work machine. I’ve implemented the above concepts as much as possible. I actually went so far as to start using VMware as my development environment (which I had talked about before). I don’t have Visual Studio 2005 even installed on my computer now. In addition, all of my development tools such as ReSharper, TestDriven.NET, and TortoiseSVN are installed in the virtual machine.

I thought it would be difficult to switch, but it’s been a pleasure. The virtual machine requires very little maintenance, and either does my host operating system. The separation makes it very clear where things get installed.

Performance has also been excellent. The virtual machine is very snappy, and I don’t notice any drop in performance. The real benefit is on my host computer. Since there is not much running, it boots like a fresh install, and everything responds like it did when I first set it up.

I also now have the option of moving the virtual machine when needed. For example, I’m getting a new laptop, and I’ll simply be able to copy the virtual machine over, and be up and running within minutes instead of hours. I’m also able to run the virtual machine on a high powered server if available. This works particularly well at home where I have a great VMware server machine. I can use remote desktop to remotely access the machine with any host. You can start to imagine where the cost savings start to come into play.

System Up Time

Today I looked at my system information, and I realized that I haven’t rebooted since I installed Windows, and got everything set up! I have rebooted the virtual machine, but I’ve never been at a point where I couldn’t be using my computer. Life is good.

Technorati Tags: , , , ,

Dell selling "Vista Premium Downgrade"

Vista Premium Downgrade

Technorati Tags: , , ,

Microsoft TechNet Conference in Green Bay

My boss was nice enough to let me go to the Microsoft conference here in Green Bay Wisconsin. I suppose it helped that it was a free event.

The morning session was a TechNet event, which means it was geared more toward the IT side of computing. In other words, as a software developer, it was pretty boring and unrelated to my job. Here were some of the more interesting tidbits:

  • In Vista and above, the TCP/IP stack was rewritten, and if you have an IPv6 network, you can see an 80% increase in network performance while transferring large files.
  • Microsoft has been using the next version of Exchange for many of their internal users. One group was given 10gb of space for mail on the server instead of the regular 2gb. That server has been working very well with load of 7500 users. That is pretty amazing.
  • Using their own spam protection instead of the previous method of stacking 7 different solutions has resulted in a dramatic decrease in the number of spam messages they have been receiving. The presenter, for example, gets about 400 spam messages/day and even more legitimate emails, but their spam protection blocks all but 2-3 per week.

I’ll discuss the afternoon MSDN session in my next post. The highlights were LINQ, WCF, and Silverlight.

Technorati Tags: , ,

Next Page »