Tuesday, October 30, 2007

DockPanelSuite: Missing A Window?

DockPanelSuite is a great open source set of dockable window tools which can make your WinForms apps a sweet suite if you’re not able to use the dockable bits in the 3.0 Framework.  (Why am I so limited, you ask?  Think support for Windows 2000 clients.  Let’s not go there.  It hurts.)

I ran into an irritating problem where I shot myself in the foot I mean some idiot missed something which cost me a silly bit of time trying to isolate.  The DockContent.HideOnClose property will keep a DockContent form opened, but inactive (hidden) if you have it set true.  This can cause some serious head scratching if you’re trying to figure out why this one form out of four isn’t closing, disposing its resources, and going away to the closed form graveyard somewhere east of the middle of nowhere.  (That would likely be close to El Nido, California, population 32 when I lived there decades ago.)

DockContent.HideOnClose.  Don’t miss it.

Saturday, October 27, 2007

Heads Up: VS 2008 VPC Expiring

Are you using the Visual Studio 2008 Beta 2 VPC image?  Be forewarned: The image expires on 1 November, 2007, not March 15th, 2008 as originally announced.

You’ve got only a couple days to work on getting your projects and TFS data off that box and on to another location.  Microsoft’s put out some guidance on moving TFS data.

Microsoft put out word of this goof themselves and is asking the community to help spread the word.  If you know anyone using this VPC then please pass word of this problem on to them.

One critical issue regarding this: Your data on that VPC will not be accessible after 1 Nov, 2007.  Get cracking and move your data off to a safe location!

Thursday, October 25, 2007

Great Turnout at Dayton .NET DevGroup Last Night

Joe Wirtley gave a nice talk on pragmatic architecture at last night’s Dayton .NET Developers Group meeting.  Joe’s a very smart fellow, passionate about getting software right, and has a lot of experience and hard knocks to share.

We had a world record for attendance at last night’s meeting: 37 souls in the door.  Wooo!

We’re running a membership drive right now and are shooting for 40 at the next meeting on 14 November.  If we hit 40 then Microsoft will donate an XBox to raffle off at the meeting.

Bring a friend to the meeting, or blog about the user group or CodeMash, and you’ll get a chance to win extra swag at the meeting!  Make sure to contact me (link on right sidebar) and let me know the URL of any blog posts you make.

Hitting 37 folks in the door last night was a big deal for me.  Our attendance has been right around 20 - 25 for a couple years and it’s great to see a big jump in attendance. 

Thanks to Joe for presenting, and thanks to everyone who showed up!

Monday, October 22, 2007

Ann Arbor Day of .NET Recap

As usual, the folks running the Ann Arbor Day of .NET did a fantastic job putting on their conference. 

I sat in on pieces of a number of good presentations: Jesse Murray’s intro to .NET 3.0, James Bender’s WCF Messaging, Josh Holmes’s bit on the Dynamic Runtime, Joe Wirtley’s Pragmatic Architecture, and several others.  All the content was great, and the audiences all seemed pretty engaged.

I did a talk on Story-Driven Development using Fitnesse.  It was my first time giving that particular talk in a full-length session — I’ve done a couple groks on it in different venues, but never a 75 minute spiel.  The talk went fairly well, but there are several areas I’ll be smoothing up for future talks.

To Jason, John, Chris, and all the other folks who worked their butts off: Y’all did a great job.  I’ve run these events before, and I know how much effort goes in to putting them on.  It was an absolute pleasure to show up and not worry about anything other than snarfing food, complaining about past crashes during presentations, and then just wandering in to my room to give my presentation.

Great job, all!

Friday, October 19, 2007

Access, SQL, VB Wildcards Compared

Here’s a handy quickref I ran across for when you need to figure out wildcards in Access, Visual Basic, SQL Server.  I never can remember the Access ones because I don’t use them but once every thirty or forty years.

(Or something like that.)

Thursday, October 18, 2007

SubSonic: Empty Generated Classes

I’m just starting to play around with SubSonic, a nifty Rails-like DAL package that handles a lot of the goo for you.  Smart Guy (tm) Steve Harman turned me on to this during a conversation some time ago and I’m just getting around to it.

The problem I ran in to right off the bat was that the wicked cool generation tool was giving me classes from the tables with nothing but using declarations in them.  Completely emtpy classes.  Not helpful.

It took me a bit, but I finally figured out that yes, you do need Primary Keys identified for each table you want to generate code against.  I’d had an ID column created with an identity set, but no primary key defined.  Duh.

I may have missed that in the numerous cool screencasts available on SubSonic’s site.  It’s an easy fix, so now I’m off to finish up a project I’m playing with for my talk at the Ann Arbor Day of .NET.

Monday, October 15, 2007

Books In The Queueueueue

(I spell it that way because I was raised in Jerry Brown’s California educational system and I figure a few extra “u” and “e” characters can’t hurt.)

Here are a few books I’ve partially skimmed but haven’t had time to fully read and report on.  I’ll get reviews out on them shortly.

Implementation Patterns by Kent Beck.  This is a manuscript copy I got before publication because, as I told the publicist, I’d happily read Beck’s grocery list if he published it.  The book is concise and appears to cover patterns to help you keep your code readable and maintainable.  Examples are in Java, but if you can’t get over that then you need to get over that.

Visual Studio Team System: Better Software Development for Agile Teams by Will Stott and James Newkirk.  Yes, that James Newkirk.  I’ve been sitting on this one for months and haven’t gotten a review out for it yet.  It’s a fine book with a lot of great content on how to do Agile (or at least some folks’ version of it) in VSTS.  There’s some jewels in here that don’t get much coverage in works — think FIT/Fitnesse and similar goodies.  I have some quibbles with the organization of the chapters, but overall it’s a very nice book.

Pragmatic Unit Testing in C# with Nunit, 2nd ed.  Andy Hunt.  Dave Thomas.  Testing.  NUnit.  Nuff said.  I’m stoked about getting through this one because their approaches to doing testing look like a huge boost.

Head First SQL  My SQL is weak, and it’s all weak knowledge from Oracle 7/8 and Sybase 10 days.  Barf.  I’m hoping this book will help me increase my SQL karma points.

SharePoint 2007: The Definitive Guide.  Looks shiny.  It appears to be a high- to mid– level guide to many features in MOSS, not a deep dive.  That’s fine because I’ve got other deep dive books.  Appears to be well-written, but I’ve only had a glance or two at it.

Windows Developer Power Tools.  Wait, you’ve heard plenty about that here already…

There are a passle of others in the queueueue, but this is what’s bubbled up to the top.  (Actually, Beck’s book pretty much landed on the top when it arrived last week.)

Sunday, October 14, 2007

Off to SharePoint Connections (Las Vegas, 4-9 November)

I got back from a week’s vacation and found that I’m off to SharePoint Connections 4–9 November in Las Vegas!  I am completely pumped about going to this conference for a number of reasons.

0) I get to go to a great conference – the first national-level conference I’ve been to since SD West back in 2003.  That was a life-changing experience and I’m hoping this conference will be the same.

1) I hope to network with a bunch of MOSS smarties and find out their experiences with solving the many pain points in MOSS development.  What build tools are folks using?  What automated testing are they using?  What other tools have been helpful? 

2) I’m hoping to get a moment with Carl and Richard of DotNetRocks and pimp CodeMash something fierce.  We’re starting to campaign to have them at CodeMash v2.0.0.8, and I’m looking for any way to hook them in.

3) I’m hoping to hook up with just about anyone in the community who’d like to gab about anything from software engineering to coffee roasting.   Feel free to ping me via the contact link on the right sidebar if you’re going to be there.  I’ll buy everyone one drink — and a crapload of straws for all y’all to share with… <g>

Saturday, October 06, 2007

Great-Looking ASP.NET Book

Jeff Atwood, Phil Haack, and a couple other fellows banded together to put out The ASP.NET 2.0 Anthology from SitePoint.  I haven’t read the book, but I can heartily endorse it despite that for two reasons:

0) It’s authored by Atwood, Haack, Galloway, and Allen.  All four of those guys are wicked smart, have tremendous experience (the invaluable hard knocks kind), and are fantastic writers.

B) It’s published by SitePoint.  I’ve been awfully impressed with their catalog over the last year.

Atwood’s got a rather ranting post where he actually discourages folks from buying the book.  I don’t know if he’s in the Post-Publication Traumatic Stress Disorder phase — I was so sick of my co-authored book when we finished that it took me weeks to do anything more than have a cursory glance through it — but I’m looking forward to getting a copy of it on my desk at some point.

Monday, October 01, 2007

CodeMash Registration Is Open!

Registration for CodeMash v2.0.0.8 is now open!  Head on over and register for the bestest software conference in the Midwest!

(But don’t register yet if you’re in the process of submitting a presentation for consideration.  We’ll have a separate registration channel for speakers.)

Friday, September 28, 2007

Join Microsoft, Get a Harley

Josh Holmes, a long-time friend who’s had a number of significant (positive) impacts on my career, joined Microsoft last year as the region’s Architect Evangelist.  Josh has a way with working deals.  Like managing to get a Harley for his job.

OK, so it’s not just Josh getting a Hog, it’s Josh coming up with a terrific concept for a great Channel 9 show: Code To Live.  He and Steve Loethen are travelling around on a Hog doing shows about passionate folks who develop code because it’s something central to their personas.  As Josh says, “Coding isn’t just a paycheck, it’s who we are.”

The show looks terrific, and with Josh behind it you can rest assured the shows will be full of great content.

Great stuff, Josh — keep it up!

Tuesday, September 25, 2007

Blogroll Shoutout

The folks at NuSoft Solutions where I worked for a short bit have made some of their blogs publicly available.  NuSoft has a bunch of smart folks and I’m glad to see they’re rolling out a public facing site.  I tried fighting for a public blog while I was there but got no traction, but I was the new kid on the block and was in Cincinnati far away from the rest of the collective.  I’m really glad to see that Chris Woodruff got the project pushed forward!

In any case, you might pay attention to that set of blogs!

Friday, September 21, 2007

CoolCommands for VS 2005

CoolCommands is perhaps one of my favorite add-ins for Visual Studio 2005 — perhaps even more so than TestDriven.NET.  Check out Gaston’s post for some of the details of its goodness.  Suffice it to say that I use features from it on a nearly hourly basis as I’m coding.

The URL for the tool is wrong on the post page, though.  You can find CoolCommands’ installer here now.

Thursday, September 20, 2007

Good (Older) Series on the /3GB Switch

Raymond Chen, author of the great book The Old New Thing, has a nice series of posts back in August, 2004, laying out what exactly the /3GB switch does for your addressing in 32–bit versions of server operating systems.

There’s an awful lot of misunderstanding around on what that switch does, and a lot of people don’t really consider the consequences of flipping that switch.

Chen’s blog isn’t a regular read of mine, but it’s a great source of information when I’m looking for anything deep level about operating systems, memory, and a host of other things.

(Go read his book, too.)

Nice HOW-TO for Creating Site Collections in a Specific Content DB

A very nice HOW-TO with pictures, even, on the steps needed for creating site collections in a specific content DB.  There’s also a bit at the bottom on how you carve off sites in an existing content DB and move them off to their own DB.

Wednesday, September 19, 2007

Finding the Length of an Image Field in SQL 2005

Problem: I need to know the size in bytes of an image stored in an Image column in SQL 2005.

Solution: SELECT DATALENGTH(image) FROM schematicsimage WHERE [schematicsid] = 527

(Courtesy of Bruce the DBA)

Wednesday, September 12, 2007

Working With LZ-Compressed Files in .NET

I’m needing to deal with some files compressed with the COMPRESS.EXE utility which packs targeted files in the Lev-Zimpel algorithm via the lz32.dll system library.  That means playing with PInvoke which is something I’d rather not do since it’s generally a huge PITA. 

To uncompress files you’ll need to open the zipped file, copy it to another file (expanding it enroute), then close your source and target files.  Three different calls from lz32.dll: LZOpenFile, LZCopy, and LZClose.  PInvoke means you need to reference those calls with DllImport statements:

[DllImport("lz32.dll", EntryPoint = "LZOpenFile", SetLastError = true,

    CharSet = CharSet.Ansi)]

public static extern int LZOpenFileA(

    string lpszFile,

    [Out, MarshalAs(UnmanagedType.LPStruct)] OFSTRUCT lpOf,

    int mode);

 

[DllImport("lz32.dll")]

public static extern int LZCopy(int hfSource, int hfDest);

 

[DllImport("lz32.dll")]

public static extern int LZClose(int hfFile);

A couple things about the first call, LZOpenFileA: The CharSet declaration makes sure that the unmanaged code gets things correctly marshalled from the CLR’s native Unicode over to the unmanaged world’s ANSI.  Secondly, the OFSTRUCT structure in the Win32 world needs defining as a .NET class in our world:

[StructLayout(LayoutKind.Sequential)]

public class OFSTRUCT

{

    public const int OFS_MAXPATHNAME = 128;

    public byte cBytes;

    public byte fFixedDisc;

    public UInt16 nErrCode;

    public UInt16 Reserved1;

    public UInt16 Reserved2;

    [MarshalAs(UnmanagedType.ByValTStr, SizeConst=OFS_MAXPATHNAME)]

    public string szPathName;

}

The string szPathName gets some MarshalAs love to deal with the transition from managed to unmanaged code.

Finally, we’ll set a couple constants for the mode we’re opening the files in:

private const int OF_READ = 0x0;

private const int OF_CREATE = 0x1000;

Now the code to actually deal with the calls:

public static string ExpandLZCompressedToTempFile(FileInfo file)

{

    OFSTRUCT sourceStruct = new OFSTRUCT();

 

    int handleSource = 0;

    int handleTarget = 0;

    string tmpFile = "";

 

    handleSource = LZOpenFileA(file.FullName, sourceStruct, OF_READ);

    OFSTRUCT targetStruct = new OFSTRUCT();

    tmpFile = FileSystem.GetTempFileName();

    handleTarget = LZOpenFileA(tmpFile, targetStruct, OF_CREATE);

 

    LZCopy(handleSource, handleTarget);

 

    LZClose(handleSource);

    LZClose(handleTarget);

 

    return tmpFile;

}

I’ll use another method to read the expanded file and stream that into a GZip-compressed format since that’s supported in .NET’s managed world.

Check out Natty Gur’s article on Code Project if you’re interested in some very, very deep PInvoke details.  His article solved a couple issues for me, but is written about sharing and caching data between processes using some interesting trickery. 

Tuesday, September 11, 2007

Visual Studio Tip of the Day

If you’re not reading it already, hop over to Sara Ford’s blog and subscribe PDQ.  She’s got an ongoing series of daily tips for VS 2005/2008.  There’s a lot of serious gold therein!

Saturday, September 08, 2007

Extreme Model-View-Presenter

ARCast has a very interesting three-part series on Presenter-First development.  There’s a lot of thought-prevoking discussion on breaking out responsibilities in a MVP pattern approached from the presenter first.  Mocks, interfaces, single responsibility principle, adapters, and an interesting take on what they see as the model. 

The folks at Atomic Object wrote a good white paper on the topic that I’ve been slowly working through. What I found interesting was their approach of having all communication to the presenter based on events spawned from the view or model.  I disagree with the algorithm (steps) they use for approaching the development (they stub out the presenter with interfaces and mocks before they even hit the user stories), but there’s an awful lot of useful info therein.

Listen to episode 1, #2, and the final installment and check out the paper.  Good stuff.

Subscribe (RSS)

The Leadership Journey