Monthly Archive for May, 2008

ThinkGeek and the lure of the 8-bit tie

Sometimes you come across things that are just so quirky, you can’t help but buy them. I finally caved and got myself one of these funky 8-bit ties from ThinkGeek. No, that’s not me modelling. As luck would have it, they’re running a buy one, get one free promotion at the moment so I have two of these retro wonders heading my way - Mario would be proud!

The 8-bit design is a nice throwback to the days of the NES and makes for something a little different around the office. Not wanting to get stung too badly on shipping ($36 to ship a tie is a bit pricey!), I got some other assorted geekery including some highly caffienated candy, a multi-tool, Timmy the ThinkGeek monkey to sit on my monitor and a couple of other bits.

I really wanted to see what all the fuss over Jolt Cola is about as well because I’m a sucker when it comes to shiny packaging - you can see why they’re called Battery Bottles! But sadly it can’t be shipped internationally. Why? I assume it has something to do with pressurised liquids but I’m not sure. Either way, it means no Jolt for me which, considering the 220mg caffeine content per can, is probably no bad thing.

Finally, a proper photo gallery

It’s been a long time since I updated the gallery. I must have literally thousands of photos lying around on my laptop and at least some of them are worth putting online! :P

Now that summer’s rolled around I’m gonna get back on track with my photography as well. My poor old camera has been sitting, gathering dust for most of the winter and it’s about time I dusted it off and went on a trip somewhere. With half term coming up, I’ve no excuse!

For the moment, though, I’ve gone and added about 400 photos from my collection which go back a good couple of years. Who knows, you might even be in one, say cheese! 8)

EduSweep Beta 6 Released

After around 3 weeks of refining code, I’m happy to announce the final beta release of EduSweep. This is the first build that is of proper release quality and from now, only major bugs will be fixed before 1.0.0.

The following bugs have been fixed in this release:

  1. Large sets of results (> 5000 results) cause the results viewer to take a few seconds to appear
  2. Scan engine may fail to recover after multiple inaccessible folders are encountered
  3. Results viewer controls behave properly when selecting multiple items and only some have been deleted or quarantined
  4. A proxy authentication error is encountered while updating the definitions
  5. Two minor bugs that were not fatal but could slow down the scan process

    There are also some notable improvements, some of which I described in detail in the previous post:

    1. The responsiveness of the results viewer has been improved while loading information for files
    2. Online update has been overhauled with a scan log and better handling of proxies
    3. Log files are now written in HTML format and give more detail about scan errors

      Go ahead and grab the download! :)

      EduSweep Beta 6 Changes

      Having taken the overwhelmingly positive feedback from Beta 5 testing over at EduGeek.net, I’ve been hard at work on the next and final beta build. Let’s have a look at what’s changed in this version as it nears release:

      New logging features in the online update module

      More robust definition updates

      The online update feature has had a major re-write, bringing a realtime log on-screen and an error log to help trace any issues. The proxy handling code has been updated and should fix the issue some people were seeing with their Squid proxies and NTLM authentication.

      On startup, the installed definitions are now verified so that if any definitions are missing or damaged, they will be redownloaded as part of the update. The definition files are now also tested before a new scan begins.

      Log files are much, much better

      Previously, log files from a scan would be saved with a rather cryptic filename as text files in the ‘logs’ folder. The actual content of a log looked something like this:

      #### Scan Summary ####

      Scan Date: 10/04/2008 12:02:07
      Files Scanned: 518
      Errors: 0
      Detected Items: 4

      #### Detected Items ####

      \\nbl-sr-02\student$\My Settings\Favorites\proxy\Freedom Proxy.url
      \\nbl-sr-02\student$\My Settings\Favorites\proxy\The OpenDoorNetwork -
      Unlock The Internet With Us! Proxy Sites For Work and School - Visit
      MySpace, Bebo, Facebook and MORE!! F.url
      \\nbl-sr-02\student$\My Settings\Recent\HACKER.lnk
      \\nbl-sr-02\student$\My Settings\Recent\pc virus.lnk

      Scan completed in 2 seconds.

      I’ve been hard at work upgrading the logging code and it’s now able to write (100% valid) html log files, which are just so much easier to work with - now that you can load them in a browser it’s possible to print them with proper formatting and word wrapping, as well as perhaps placing them on a web server for easy access anywhere.

      There’s also some new information that’s written to the logs. First, the scan summary now includes the user that started the scan and the time taken. The scan summary looks like this now:

      Scan date: 06/05/2008 11:49:53

      Scan requested by: paulb

      Scan took 11 minutes and 14 seconds to complete.

      Number of files scanned: 144150

      Number of files detected: 166

      Second, and more importantly, the logs show detailed information on errors instead of just a count. Some of the more common errors you may encounter are:

      • The specified path, file name, or both are too long. The fully qualified file name must be less than 260 characters, and the directory name must be less than 248 characters.
      • Access to the path ‘C:\System Volume Information’ is denied.

      Both of these are normal on a standard filesystem. The second is often triggered by the scanner trying to access system folders and it will continue just fine after skipping them. If a folder is skipped that definitely isn’t a system folder, check that your user account has read access.

      The results viewer is much quicker

      Notice the amount of results and the progress bar for the thread

      It’s hard to design a viewer that has to handle several thousand files and stay responsive. Beta 5 could slow down quite a bit if your scan returned a lot of detected items. I’ve added some threads to make loading data and working with files feel much more responsive throughout.

      The progress bar bottom right shows the progress of gathering data for the files and populating the list.

      Framework folder fudges in .NET

      I love the .NET Framework. I mean that purely in a platonic sense, of course - it’s not *that* good. :lol: As with all platforms though, it falls down in certain areas. Java has its slightly quirky date APIs and I think one of .NET’s quirks has to be folder handling.

      Back in my day…

      Like many people, for better or for worse, I started out programming in VB6 around 2003. I’d managed to write some fairly decent programs - decent more in functionality than code quality, I admit. When Visual Studio .NET 2003 came out, I started learning to program in C# on the then relatively young .NET framework. I was having so much fun, in fact, that I asked for Visual C# Standard for my birthday!

      Back then, the .NET framework made learning a new language much easier. There was a nice set of standard libraries, automated garbage collection and I found that a lot of the methods I was writing in VB were included as standard in the framework.

      Rose-tinted specs

      Recently, though, the framework has been getting on my nerves in a pretty big way. Sometimes the way it handles basic operations is odd, unreliable or just downright broken. One such problem is handling folders.

      EduSweep, my network sweeper, scans entire drives for unwanted files. The process it uses goes something like this:

      • Get the list of targets that the user selected
      • For each target, get all the subfolders and make a list of them
      • For each folder in the list, scan its files

      And that’s pretty much it; it’s not very complex, nor does it need to be. The framework has other ideas, however. By far the simplest way to get all the subfolders of a path would be to use GetDirectories like so:

      GetDirectories(“*.*”, System.IO.SearchOption.AllDirectories);

      That initially looks fine but let’s assume that we have a folder somewhere on the drive that is inaccessible due to insufficient permissions. A good example is the system folder “System Volume Information” in the root of drive C. The code attempts to get the subfolders for the folder but fails because the directory listing is denied.

      We can wrap that code in a try block, catching the exception, but then no results are returned at all! The method is essentially useless because you know that, as soon as it encounters a single folder it can’t access, it throws its toys out of the pram. The only alternative is to manually recurse through the directory tree, enumerating folders and subfolders along the way. :mad:

      Would it be so hard to skip folders along the way and return a string array of failed directories?