Tuesday, January 29, 2008

Moving windows from screen to screen

I've been using 2 displays to do software development for many years now and found it makes things significantly easier. However, I've become increasingly irritated with the process of moving windows to different screens as I use them. This has been exacerbated by the fact that my new work laptop has a resolution that doesn't match that of the external screen, leaving disparate display sizes. I'm often moving applications back and forth in order to see more or simply organize them for more useful views.

Although it certainly isn't very new, I only recently discovered a very handy tool that solves this problem. Oscar's Multi-Monitor Taskbar is a free tool that adds a taskbar to secondary monitors. The additional taskbar shows the buttons for the applications that are on the same screen, while those buttons are absent from the main windows taskbar. It also adds a button to each window title bar next to the min/maximize buttons that performs single click window relocation between screens. This screen relocating can also be performed using shortcut keys (CTRL-ALT-LeftArrow/RightArrow). While the taskbar tool looks very useful, this implementation of it has some distracting side effects. The real taskbar flashes with partial button imagines when you switch between apps.

Fortunately, there is also a stripped down version of the tool that just adds the screen switching buttons. The one drawback I found is that this version lacks the shortcut keys. Regardless, a single click is considerably better than restore-drag-maximize.

Wallpaper and screen savers for IT people

I am an information technology professional, a software developer to be precise. I spend nearly my entire work day sitting in front of a computer. If I'm not at the computer I'm either reading a trade magazine or a programming book, down the hall talking with other developers or slurping ramen noodles while watching/listening to a technology podcast. I also have a 2 year old who, if I may say so, is rather cute.

What then is my desktop background? It's the ultra plain and boring Windows default teal blue. It's not a picture of my kid, pet, house or favorite vacation spot. It's a solid wall of lifeless monochromatic color.

What then is my screen saver? It's not beziers or starfields or 3d flower boxes. It's the default black screen with the Windows XP floating logo. Almost as boring as the wallpaper, but with movement.

I see banners for screen savers or hear technical people talking about power toys that provide nifty screen savers and wall paper goodness. Who has time for that? There's work to be done! What are these information workers doing that allows them to spend time staring at their computer's desktop wallpaper? And then staring long enough for their screen saver to kick in?? Don't they have work to do? Don't they have useless desktop add-on reviews to write?

And what about the screen savers? Do we even need them any more? Sure they were useful when we ran monochrome green CRTs, I suppose ATM and POS displays are legitimate applications, but everyone in my office runs a laptop with an external flat panel display. What's the purpose of the screen saver now apart from killing productivity? Do out LCDs really need saving? The only useful screen saver I see (or rather don't see) is the auto power-down mode.

If you are going to leave your workstation long enough for the screen saver to kick in, let it power off automatically or just shut it off and save a few watts . I'm sure your desk chair won't be any less entertained.

Wednesday, January 23, 2008

Fixing Vendor Data: Malformed PDFs and Internet Explorer

I encountered an interesting problem today dealing with PDFs. The online Chilton applications I manage have over 10 gigabytes (75,000+) technical service bulletins in PDF form. Today we got a support call about some of them rendering to the browser as plain ASCII. I attempted to reproduce the problem on my system but found nothing wrong. After considering that it might be a browser issue I tried Internet Explorer and, sure enough, I could reproduce it. I tried several PDFs in Internet Explorer, FireFox and Opera. Only Internet Explorer had the problem. Instead of launching Adobe Reader and displaying the PDF in it, I got the raw contents of the PDF file in the browser in plain text.

I started comparing the contents of the PDFs to see if the offending ones looked corrupt. While my PDF reading skills are quite those of Adobe Reader, I discerned that the files didn't seem to be messed up. The PDF headers and footers looked normal. One thing I noticed was a point difference in the PDF version number in the file itself. I could imagine this could be the culprit. After all, all 3 browsers use the same Adobe Reader plug-in and the offending files worked fine in Firefox and Opera.

I wondered if there might be something amiss with the mime types that was throwing something off. This was another longshot but I checked away. After a few minutes with Fiddler, all looked kosher.

I went back to the PDF contents. After looking at some that worked and others that didn't I noticed that the ones that caused the problem had several blank lines at the beginning. In a test with a single file I removed what I thought to be harmless blank lines and viola, the problem was solved. Apparently Internet Explorer doesn't just push the PDF off to the reader based on the HTTP content type (application/pdf) but was actually reading the file. When it encounter something other than the typical open bytes of a PDF (%PDF-) it decided that it would just dump it out as plain text instead of handing off to the appropriate application. It seems that the other browsers don't do this and the extra bytes in the file are harmless to the PDF itself.

I ended up writing a fairly simple app to search the file byte by byte to find what should be the correct starting point. Simply stripping out a series of whitespace bytes (byte value 10), the files get cleaned up and work just fine.

Yet another story to reinforce that you can't always trust your vendor's data.

Thursday, January 17, 2008

Side gig: Wrox book Technical Editor

My friend in Holland, Imar Spaanjaars is putting the finishing touches on a new book Beginning ASP.NET 3.5 : in C# and VB.

I took on the role of Lead Technical Editor. It was a tough and time consuming but rewarding process. I learned about some of the new features that Microsoft has released with ASP.NET 3.5, notably LINQ. It also gave me a chance to play in an environment that I don't usually use, the Express editions of the Visual Studio product family. I also used some of the controls that were introduced with 2.0 that I don't normally use but probably should.

Mostly, this project gave me a chance to work closely with Imar (as much as you can with an ocean between you). I have known him for many years from our existence on the Wrox p2p forums and had the fine opportunity to visit him in Holland while I was on a business trip. When he's not off writing a book we have the occasional technical chat on IM and I think we both get a lot from it. It was nice to work on an official project with him despite it not involving any actual software development.

Overall a worthwhile experience, although it will be nice to have some time off before the next extracurricular project. I know that he'll be ecstatic when it's finished.

Another yearly post

Well, it's been another whole year (+1 day) since I posted here. "What's been going on", you are no doubt wondering. Well...

The year has changed. That's right it's 2008 now! Time to buy another calendar.

The new job is going well. I started working for Thomson Delmar Learning in November last year. Then Thomson sold us to a private holdings company and we assumed the new identity of Cengage Learning. I still have a job, that is good. But even if I didn't have this one any more I am not too worried as there are plenty of jobs for .NET developers in my area. (I silently wonder if I shouldn't be gazing out at more luscious pastures...) I like my job though so in the off chance anyone I work with is reading this (unlikely) don't be worried. Despite all the changes ensuing after the company's sale not much has changed in my little world which incidentally is that of Chilton Automotive. I'm in charge of three main web product sites: chiltonpro.com, chiltondiy.com and chiltonlibrary.com. It's interesting work and a good place to be. It's a 10 minute walk from my house so I haven't driven to work in nearly 14 months which is very nice.

Spencer is now 2 and being a 2 year old. We have been fortunate and he has not had any major problems aside from the occasional diaper rash and minor cold. He sleeps well, eats OK and is pretty happy most of the time, mostly to the credit of his mother.

Aside from that it's pretty much the status quo here. There are a few more things that I'll discuss in other posts.