TCP Offloading

I try not to get too techy in my blog here most of the time, so I apologize in advance for the density of the material.

I've got a few aging production servers that I'm responsible for (Windows 2008-era). Over the past year and a half, I've been having intermittent connectivity problems. Tons of exceptions are being thrown that indicate the server is just...dropping connections randomly. Dropping connections to the client, the SQL Server, or really anything larger than a tiny networking blip. It's not constant enough to warrant a "drop everything and figure this out" response, so it's just been this constantly irritating background noise to more pressing software development concerns.

To add, the error message read "The client disconnected. Invalid viewstate." We're not even using .Net's viewstate that much, so I was understandably confused. I made a few half-hearted attempts to track down the issue, but kept coming up empty.

After finally getting tired of the error and reading a several articles on the subject (also glossing over quite a bit of poking at the code), there seemed to be an issue with Broadcom gigabit NIC cards utilizing the TCP Offload Engine. This nifty feature is supposed to offload checksum calculation and some other TCP stack heavy lifting to the operating system in order to improve networking performance. The recommendation was to disable it entirely.

disable-tcp-offloadAll our production servers have Broadcom ethernet cards, so after disabling it on all our production systems, our dropped connection issues stopped completely. Fast-forward to several months later, and I'm debugging a problem wherein an application crashes when trying to download a large block of data from a remote SQL Server system, and getting the error: "A transport-level error has occurred when receiving results from the server. (provider: TCP Provider, error: 0 - The semaphore timeout period has expired." Pretty obscure.

This system in particular is a virtual machine running in a Hyper-V server with a physical Intel card, so I dismissed that possibility and focused on the code. After losing a day running down that rabbit hole, I discovered from the "Troubleshooting Common Hyper-V Errors Part 3" article that you can, indeed, be using a TCP offloading engine without a custom driver.

The article recommends disabling only Large Send Offload, but I'm really sick of this issue. Rather than taking a stepwise approach to solving the problem, I've just gone ahead and disabled offloading for all servers that are pre-2012 since Microsoft disabled the feature in 2008 R2 onward for gigabit adapters (presumably because it's so problematic). If networking speed is compromised as a result, I'll upgrade the hardware in question.

I hope I can save someone else the time figuring this issue out.


Flip These Games!

Categories Gaming

I've decided to turn my game collection into more than just a hobby. Starting today, I've opened a shop on Etsy for vintage video games.

I've been collecting video games since as long as I can remember, but the collection process is fraught with setbacks. That guy who borrowed that one NES game back in 1991? Left a box of NES games behind (including 4 different Mega Man games) when moving? Scratched discs? Kids?

Well, I don't loan out my games anymore, my kids are grown, and I'm not leaving another goddamn box of games behind anywhere. So what does that mean?

It means that through the process of collecting over the years, I've picked up a bunch of duplicates and games I just don't want to keep because of condition or preference. Also, I need to fund more game pickups!

Head on over to my Etsy shop and own a piece of retro gaming history!


PHP PDF Libraries

Categories Programming
PDFs are easy! Like riding a...oh.

PDFs are easy! Like riding a...oh.

I wanted to do something I figured would be relatively simple. After all, we're doing it in .Net with a third-party library: Create a PDF with text from a database with vector graphics incorporated in the page. Turns out, it's pretty easy if you want a paid solution; numerous libraries exist for PHP that are non-free. If you insist on going free-only though, be warned: here be dragons (maybe).

Continue reading this entry ▶


HP Color LaserJet 3600 Windows 7/8/8.1

Categories Miscellany

I honestly don't know why HP hates its customers. They assume I want to use USB to connect a business printer, or want ~140MB for a driver, or want some other print management software instead of just a driver.

So here you go. The HP Color LaserJet 3600 64-bit driver for Windows 7, 8, and 8.1. (14.2 MB)


SimpLESS: An Easier Way of Getting LESS Done


When I first took a look at LESS as a CSS replacement, I wasn't too interested in having even a command-line compiler. The idea of having my stylesheet loaded and parsed by Javascript didn't sound that great either, but tolerable if it saved me enough time and effort writing CSS.

SimpLESSWhile testing LESS on my local server, I used less.js to process my .less stylesheet on the client side. It worked well, and on modern browsers the processing time is minimal, but I decided to look around for LESS compilers anyway. I discovered SimpLESS nearly immediately, and it looked perfect.

Compiling a .less file is as easy as drag-and-drop, and it monitors the file for changes. When your file is saved, it is nearly immediately compiled into a CSS file. If you've made an error in your file, the file highlights red and specifies the line number at which the problem occurred. Output is pure, minified CSS goodness.

SimpLESS, by default, inserts a comment at the top referring to its website. This can easily be disabled if you like.

When I first started using SimpLESS, I was copying and pasting the output into a WordPress template style.css file, which requires a properly-formatted comment at the top to describe the theme. Since SimpLESS performs minification, comments are stripped out. I thought this was the only way to keep my WordPress theme comment intact while still using the features of LESS. This copy-paste tedium was something I specifically wanted to avoid in the first place.

Note: The remainder of this post was written before SimpLESS users complained enough about this very issue, so theme comment preservation is no longer an issue.

I thought that there must be some way to preserve a comment when compiling. Surely that wasn't an uncommon use case? I checked out the SimpLESS source code to see how it was performing its minification (master/Resources/js/clean_css.js, line 30 if you're interested), and saw they included a special character to preserve certain comments: the exclamation mark.

To preserve a CSS comment in SimpLESS (not that this will not work using the Javascript version, as WordPress will not find a style.less file), simply put an exclamation point after the initial comment delimiter, like so:

Theme Name: My Super-Cool Theme
Theme URI:
Description: Blah blah blah...
[cut for length]

The exclamation point is ignored by WordPress, and if you have SimpLESS processing your style.less file, you can continue to upload your theme's style.css file as usual.


Clear Photoshop’s Swatch Palette

Categories Design
The Photoshop swatch palette

Everybody wants a rainbow, apparently.

Whether you're trying to save a specific set of colors for later use, or simply want a palette with only your colors on it, you'll likely have encountered a problem that has been plaguing Photoshop for as long as I remember, and still hasn't been addressed in CS5 (or CS5.5, that I know of): how do you clear the swatch palette?

The only things you can do from Photoshop's own menus are:

  1. reset the swatch palette to the default colors
  2. replace the palette with a new swatch palette by selecting "Replace Swatches."

Anyway, there are two ways to clear the swatch palette completely. Actually, there are three, but one of those is to manually right-click each swatch and select Delete swatch." If you've got way too much time on your hands, this would be the way to go. For the rest of us that would rather get on with our lives, there are two better methods of clearing out the palette.

The first method is to do it manually, only with the help of a keyboard shortcut. While holding your mouse cursor over the swatch palette, hold down Alt ( Option on Mac). Your cursor should change to a scissors icon (). Click any color in the swatch palette to delete it. You'll have to do this over a hundred times to clear out the palette, but if you're a furious clicker like me, you can have this done in under 10 seconds (I play Starcraft, so...yeah).

The Alt/ Option clicking works fairly well, but is still somewhat labor intensive. If you want to clear it even faster, you can download this (mostly empty) swatch file. It includes only one color, black, so you can simply delete this single swatch and begin filling the palette with your own colors.

Download the file below: (50 bytes)