Marquee de Sells: Chris's insight outlet for category 'tools' via ATOM 1.0 csells on twitter

You've reached the internet home of Chris Sells, who has a long history as a contributing member of the Windows developer community. He enjoys long walks on the beach and various computer technologies.




Visual Studio 2008 Has Been Released!

From the Visual Studio home page:

Enjoy! I know I have been.

0 comments




Releasing the Source Code for the .NET Framework Libraries!

After programming with MFC (a lot!) and writing the ATL book, it was *very* difficult for me to live in a world without the source code to figure out how something was working. All of us have since moved over to Lutz's most excellent Reflector, but that's still no substitute for actually stepping in and now ScottGu has announced that we'll have the ability to browse and debug with the .NET library source code, integrated into VS2008:

Wahoo!

0 comments




Shawn has prepared Genghis v0.8

Shawn Wildermuth has prepared a v0.8 release of Genghis that includes a bunch of stuff that the folks that put the v0.6 release together dropped. The v0.8 release has all the good stuff from the v0.5 release and all the new stuff from the v0.6 release in a .NET 2.0 package.

Shawn's really done all the work for Genghis since I came to Microsoft. Thanks, Shawn.

0 comments




Genghis moved to CodePlex

Shawn Wildermuth has moved Genghis to CodePlex because GotDotNet Workspaces is going away. I actually really like CodePlex, but not the state those pesky contractors left the Genghis bits in, so we'll be following up with another release in early July to bring sanity back. Thanks, Shawn!

0 comments




Show Me The Templates!

Show Me The Template is a tool for exploring the templates, be their data, control or items panel, that comes with the controls built into WPF for all 6 themes.

Show Me The Template screenshot

Enjoy.

0 comments




Visual Studio Orcas March 2007 CTP

And the hits they keep on comin':

Enjoy!

0 comments




Lutz Roeder's Reflector 5.0

Need I say more?

0 comments




Detailed Time Zone Data

A long time ago (2000), I was fascinated with turning a phone number into a time zone so I could tell what time it would be somewhere before I called and woke anyone up (this happened too often : ).

As part of that work, I quickly realized that info in Windows for time zones wasn't detailed enough, so I began looking elsewhere. I found the Time Zone Map Group, which maintains time zone data for all over the world backward through time. This is an amazing accomplishment, since they have to account for every law change as each tin pot dictator comes to power, e.g. George W.

At the time, they had a custom format for the data (and they probably still do, as far as I know), so I wrote a utility to translate the tz format into XML for easy parsing. I literally haven't touched the tool since, but with the recent time zone law changes in the US, I thought folks might be interested. Enjoy.

0 comments




.NET: Decompressing zip file entries into memory

I knew that the J# libraries in .NET had zip file support, but I couldn't find any samples that showed how to decompress the files into memory. The hard part, of course, is that the J# stream objects aren't the same as the .NET stream objects. If you're a Java programmer looking for a familiar library, that's great, but I'm not, so I had to do a little finagling.

The first thing you need to do is to add a reference to the vjslib assembly, which brings in .NET classes in Java namespaces, e.g. java.io. The one we care most about is java.uti.zip, which includes ZipFile and ZipEntry. We also need java.util for the Enumeration class and java.io for the InputStream class. With these in place, we can enumerate a zip file:

using java.util; // all from vjslib assembly
using java.util.zip;
using java.io;
...
static void Main(string[] args) {
  if( args.Length != 1 ) {
    Console.WriteLine("Usage: dumpzipfileoftextfiles <file>");
    return;
  }

  // we're assuming a zip file full of ASCII text files here
  string filename = args[0];
  ZipFile zip = new ZipFile(filename);

  try {
    // enumerate entries in the zip file
    // NOTE: can't enum via foreach -- Java objects don't support it
    Enumeration entries = zip.entries();
    while( entries.hasMoreElements() ) {
      ZipEntry entry = (ZipEntry)entries.nextElement();

      // read text bytes into an ASCII string
      byte[] bytes = ReadZipBytes(zip, entry);
      string s = ASCIIEncoding.ASCII.GetString(bytes);

      // do something w/ the text
      string entryname = entry.getName();
      Console.WriteLine("{0}:\r\n{1}\r\n", entryname, s);
    }
  }
  finally {
    if( zip != null ) { zip.close(); }
  }
}

Notice the use of the Enumeration object so we can enumerate in the Java style and the use of the ZipFile and ZipEntry types. This is all stuff you could find in readily available online samples (I did). The interesting bit is the ReadZipBytes method:

static byte[] ReadZipBytes(ZipFile zip, ZipEntry entry) {
  // read contents of text stream into bytes
  InputStream instream = zip.getInputStream(entry);
  int size = (int)entry.getSize();
  sbyte[] sbytes = new sbyte[size];

  // read all the bytes into memory
  int offset = 0;
  while( true ) {
    int read = instream.read(sbytes, offset, size - offset);
    if( read == -1 ) { break; }
    offset += read;
  }
  instream.close();

  // this is the magic method for converting signed bytes
  // in unsigned bytes for use with the rest of .NET, e.g.
  // Encoding.GetString(byte[]) or new MemoryStream(byte[])
  return (byte[])(object)sbytes;
}

For those of you familiar with Java, I'm just reading the zip file entry data into an array of signed bytes. However, most .NET APIs like unsigned bytes, e.g. "Encoding.GetString(byte[])" or "new MemoryStream(byte[])", which means you've got to convert a signed array of bytes in .NET to an unsigned array of bytes. Unfortunately, just casting doesn't work (the compiler complains). Even more unfortunately, I could find nothing in the Convert or BitConverter classes to perform this feat of magic and the code I wrote was dog slow, so I asked around internally.

Luckily, James Manning, an MS SDE, had the answer: cast the signed byte array to an object first and then to a unsigned byte array. Thank goodness James knew that, because I didn't find anything on this topic. Hopefully future generations will find this missive.

You can download the sample if you like. Enjoy.

0 comments




Windows Servers for the rest of us

Charlie Kindel of COM fame (he's wrote the foreword to Don's seminal work "Essential COM") is the Product Unit Manager (softie-speak for "butt on the line") for the new Windows Home Server team. If you haven't heard about it, Home Server is a Windows server box for the rest of us. I don't know about you, but I've got file, print and media servers all over the house in a confusing mess and I look forward to being able to consolidate it. According to the enthusiastic beta tester I talked to, Windows Home Server is the way to do that.

Yesterday, Charlie announced the Windows Home Server Blog. Enjoy.

0 comments




Window Clippings 1.5

Capturing screenshots for a book used to be a piece of cake. Alt+PrintScreent and you were golden. However, sometimes I wanted to get the cursor, too, and neither Alt+PrintScreen nor PrintScreen does that, so I got myself a copy of SnagIt. Unfortunately, if I wanted to capture multiple screens, I was putting a maximized copy of Notepad in the backgrand, using PrintScreen and PBrush to do the cropping (although SnagIt has slightly more seamless multi-window selection).

Still, this all worked 'til Vista came along and Alt+PrintScreen left the shadows out! I was fine with that, but Ian correctly pointed out that the screenshots with the shadows looks *so* much better that I could hardly say "no." And I discovered the Snipping Tool in Vista, which let me do a selection on any part of the screen I wanted to, except that now instead of just doing Alt+PrintScreen, even for a single window, now everything is a selection, which means that somebody (hopefully not me!) has to trim the extra whitespace to make sure the pictures layout OK in the book.

I told you all of that so you could know that I envy folks that don't have to do screenshots! It's hard to make it look right, although, for visual technologies, I really can't imagine not having them. Anyway, I was definately open to another screen capturing technology and that's when someone turned me on to Windows Clippings.

When I found Kenny Kerr's most excellent screen capture tool, it was so close to what I wanted (it did Vista shadows with no guesswork!), that I sent Kenny an email with my feature request (easy child+parent capturing support), fully expecting not to hear back (it's clear from his web site that he's a busy guy!). Not only did he reply, but he'd implemented my feature!

And it was such a time-saver, that I forwarded it along to Ian, who had his own feature request (keeping the transparency in the captured image w/o grabbing the stuff underneath), which Kenny promptly implemented (with some example code from Ian). Of course, that broke my feature (the constant animation of WPF apps + capturing transparency caused problems), so Kenny fixed that, too. By this point, Kenny's app itself was notifying me of updates faster than he could send the emails.

All of this is merely to say, I'm really loving my Windows Clippings experience. Thanks, Kenny!

0 comments




CodeFetch: Search Book Source Code

CodeFetch allows you to search in the source code associated with books (like the code I publish for my books). Plus, it lets you choose the language to search on and shows the book the results come from so you can read your favorites. Very cool.

0 comments




Point: Local Live Maps

When it comes to Web 2.0 apps, online maps are easily the thing I use the most. I don't go anywhere these days w/o first pulling up the map on MapQuest, Google maps or, for a coupla years now, local.live.com (starting back when it used to be called MapPoint). I generally use Google for my search engine, so don't think it's just the MS employee thing pushing me -- I genuinely like local.live.com better.

Google and MS have been in an arms race for years on the maps stuff, doing fancy stuff like 3D globes and other goo that looks good in demos, but that I don't need. However, in this war of the world (so to speak : ), today MS fired a decisive shot across the bow, I think -- the "Send" menu. This is huge for me, because I can send the directions to my phone, either via SMS or via email, and I get a great display clearly optimized for my smartphone. Not only does it have a great mini-map, but the directions are easy to read (saving me from printing the directions for just a single trip) and it has a link to reverse the directions (the one thing I never remember to do).

Oh sure, I can do the same thing with the Google maps "Email" menu, but when I follow the link on my phone, there's no map (although there is a handy link to reverse the directions). Also, the directions don't read as well and I swear it's faster to surf to the local.live.com directions (although this might just be the MS bias talkin' : ).

On the other hand, I just noticed that Google maps has a new "Add destination" link for multi-destination trips, which is the only thing I use AAA online TripTiks for and you have to be a member to access the feature (I am, but still it's kinda clunky...). Hey, local.live.com guys -- can I have that, too?!?

P.S. I think I've scared the most reactionary, close-minded folks away, so I think I'll cool it on the postscripts for a while ('til I feel like it again : ). BTW, my definition of "close-minded" is "those who don't think I have the right to express my opinion," not "those who disagree w/ me." Hopefully I managed to shake the former off my RSS feed while keeping the latter.

0 comments




VS2005 SP1

"Through further advancement and feedback, Service Pack 1 ... provides over 70 improvements for common development scenarios including:

For more information, see the Microsoft Download Center:

At the time of this posting, VS05SP1 update for Vista download wasn't available, but it should be directly.

P.S. I hope everyone is enjoying the holiday season with peace, love and understanding.

0 comments




XNA Game Studio Express Has Been Released!

Oh, man, I *so* want to write a game that runs on my Xbox 360! Now I can (and so can you). Enjoy!

P.S. Impeach!

0 comments




205 older posts       15 newer posts