Attention: We are retiring the ASP.NET Community Blogs. Learn more >

Contents tagged with General Software Development

  • Installing PyGTK on Windows x64

    If you’re doing any work with Python you might need a user interface as Python doesn't provide one. Once such interface is provided by the GIMP Toolkit (GTK) in the form of Python bindings called PyGTK. PyGTK is actually made up of three dependant libraries:

    Installing these bindings on an x64 system (XP, Vista or Windows 7) makes for a challenge. After installing Python 2.x you might find yourself staring at this dialog when you try to install any of these libraries:

    What’s happening is that the installer is looking in the registry for an entry to find where Python is installed. You might be looking at your registry and see this under the HKLM node:

    While this node is valid (it’s what the Python 2.x installers create) it’s not what the installers for PyGTK are looking for.

    The installer will look first under HKLM\Software\Wow6432Node\Python\PythonCore. Failing that, it'll look under HKCU\Software\Python\PythonCore. On x64 systems, the Wow6432Node doesn’t exist however it does exist under HKLM\Software\Python\PythonCore. (there’s no entries under HKCU on x64 systems, at least none that I can find).

    There’s a quick fix you can do to get going.

    Right click on the existing HKLM\SOFTWARE\Python node and choose Export. Now edit this file and add “Wow6432Node” between “SOFTWARE” and “Python”. So this:

    [HKEY_LOCAL_MACHINE\SOFTWARE\Python]

    Becomes this:

    [HKEY_LOCAL_MACHINE\SOFTWARE\Wow6432Node\Python]

    Do this for all of the HKEY_LOCAL_MACHINE lines and save the file.

    Now back in the Registry Editor click on File | Import. Select the file you just saved. A dialog will appear saying the information has been successfully imported into the registry (you could also double-click on the .reg file and confirm the import).

    Now view the HKLM\Wow6432Node in the Registry Editor and you should see the newly imported Python node.

    You can now run the installers and they’ll find where Python is installed and complete for you.

    BTW, you could also import this into HKCM (the node for the Current User) but that only works for that specific user and you might want to do it for all users. If you do choose to go the HKCU route, make sure you edit the path correctly in the .reg file as it needs to be [HKEY_CURRENT_USER\SOFTWARE\Python] not [HKEY_LOCAL_MACHINE\SOFTWARE\Python].

    Hope that helps!

  • Alone in the Dark with Microsoft Desktop Virtualization

    I don’t often get too bitchy with the mother ship, but I have to say that I’m highly disappointed with Microsoft and it’s desktop virtualization strategy. In fact, they really have forced us SharePoint developers to go down very few paths, and most roads lead to VMWare.

    As a SharePoint developer one of the things you have to contend with is your development environment. As SharePoint only runs on a server (we won’t get into the unsupported Bamboo work around to get it running on Vista) it does make development a bit of a challenge. After all, as a web developer you just install IIS and off you go. With Visual Studio 2005 and above, the web server was built-in for you so you didn’t even have to install IIS. For SharePoint it’s a whole ‘nuther story. The minimum setup you need to hit the ground running with SharePoint is Windows 2003 Server (although 2008 installs much faster and is quicker to get setup) and a copy of SharePoint. For development and demos you *can* install it with the built-in Windows database, but you’re going to need to install Visual Studio anyways so you might as well have it sit on top of SQL Express at least. If you plan on doing any Reporting Services integration then you might as well install SQL Server Developer Edition with Reporting Services instead. In other words, to get a fairly decent rig up and running (minus any multi-server configurations) you’ll need about 30gb and a day or so to install and configure everything.

    So to get any traction enter virtualization. The ability to start up your server (sometimes from a saved state) and start developing. Microsoft currently offers up 3 tools to do this (pretty much all free, although Hyper-V requires Server 2008). Virtual PC, Virtual Server, and Hyper-V. Any of which has it’s advantages and disadvantages but we won’t get into a compare and contrast post here. This is about where do we go from here? I fully blame Microsoft for this. I can’t spin it any other way. They went full-on with Hyper-V but left desktop users in the dust.

    Virtual PC was acquired from Connectix and turned it into a pretty good alternative to VMWare’s workstation offering at the time. Grant you, VMWare has been up to date on things pumping out newer versions with better and better features while Virtual PC, well… It really hasn’t changed from the 2004 release and that release didn’t really change all that much from the 5.0 version from Connectix. Sure, new guests were added and I’m sure they’ve made some performance improvements internally (did they? I have no evidence to say either way).

    There you are, trying to figure out what options you have. Virtual PC 2007 is IMHO all but abandonware. The last service pack added Vista and Server 2008 guest OSes but in reality, the product is dead and I see no future for it. The team has moved onto the Hyper-V group and the product may as well be dropped as it has no future (feel free to chime in here guys and prove me wrong). Looking at Ben Armstrong’s Virtual PC Blog, the last year or so of entries are all about Hyper-V with a few entries about getting some obscure game running on Virtual PC. As for Virtual Server, that’s even more so abandoned than Virtual PC (again, “R2 Service Pack 1” was released but all it did was add new guest OSes to the mix). The product still carries the “2005” branding and there’s no Virtual Server 2009 or 2010 anywhere to be seen (correction, ask a softie and they might say “Oh you mean Hyper-V!”).

    For those that are thinking about running Hyper-V that’s a fair option but think first. This is a server product so running Server 2008 on a laptop (because it gets really expensive in freight and pretty heavy to lug around desktops to conferences) isn’t really an option. Call foul if you will and hey, I ran Server 2008 on my last laptop using the most excellent resource win2008workstation.com but guys, this is a server OS and having it as your primary OS on a laptop isn’t a long term solution (there’s so many workarounds to try to get “normal” desktop applications running on it, and don’t even try to do mobile app development). As for Hyper-V on Server 2008 on a laptop, it’s possible but a) your system BIOS needs to support it and b) you need enough horsepower to get Hyper-V running as well as the OS and 2GB really isn’t going to cut it. Again, machines are becoming more and more powerful but I really don’t want to haul around a machine that takes down the Eastern Canadian Power Grid every time I fire it up. Support (for those that do tend to like to have it) is probably going to be hard if not impossible on a laptop running Server 2008 and Hyper-V. I just don’t think Microsoft has marketed this combination nor is going to give you much assistance when you call PSS with a problem and describe your setup. I could be wrong but I think there’s a reason why we have server class machines and workstation based operating systems. Live on the edge, but when it comes to my daily bread, I don’t like to take big chances that haul me into long downtimes rebuilding a server (even a virtual one).

    So where exactly does that leave the desktop developer that needs a server OS (aka SharePoint, although I’m sure there might be others). Hello VMWare! Yup, Microsoft has conveniently driven us right into your arms. Don’t think so? I don’t see a x64 guest option anytime in the future for the aging Virtual PC or Virtual Server and with the next version of SharePoint being x64 only, where do you turn if you need to be portable. VMWare already supports x64 guest operating systems. You following me Virtual Guy?

    Let’s go over the options for portable server-type development then:

    1. Stick with Virtual PC 2007 SP1 but you’re basically screwed if you want to do SharePoint 14 development with it.
    2. Stick with Virtual Server R2 SP1 but get screwed for the same reason as #1
    3. Run Server 2008 on your laptop and enable Hyper-V (assuming your hardware supports it and you don’t need certain programs)
    4. Run VMWare Workstation right now and keep running it for years to come.

    Yeah, so many choices huh? Thanks Microsoft.

    Am I wrong? Please beat me down in the comments.

  • How do you know she’s a witch?

    She looks like one! So begins one of my favourite skits in movie history, the witch scene from Monty Python and Holy Grail. The gist of it is: If she weighs the same as a duck then she’s made of wood and therefore… A witch! And what do we do with witches?  We teach them Agile!

    ShesAWitch

    What do witch hunts have to do with software development? Plenty.

    How do you know you’re really “doing Agile” or following Scrum practices in your project? How do you know if you’re doing the right thing or not? How do you know when it’s done? How do you measure success? Why is the sky blue?

    All of these questions come up when things start going sideways in the Agile sense, and you fall into the Scrummerfall way of doing things. Practicing traditional Waterfall management techniques but calling it Scrum. Tasks are assigned to people rather than claimed by owners. Customers are non-existent and uncommitted. And the team really doesn’t know what they’re delivering or why, they just keep doing stuff to stay busy because the PM tells them to.

    Brad Wilson describes Scrummerfall as the way to ensure failure at a much faster rate than you had with Waterfall alone. There are some clear signs you’re on a slippery slope and if you see them, you should grab hold of something (preferably a pair of coconuts) and find yourself a swallow (African or European – your choice).

    Three key things that you can bank on in Scrum:

    • The practice regularly delivers business value
    • The team is frequently aligned with the business requirements
    • The business drives the project based on their needs and values

    There are other elements of Scrum here but I like to highlight these ones as they’re not bogged down in techno-babble terms that nobody understands.

    Delivering Business Value in a Predictable Way

    A sure sign of Scrummerfall is having a schedule that follows some mythical Gantt chart or Waterfall-ish schedule that’s about delivering “phases” or “stages” of the product. Waterfall PMs will plaster these on the wall, attach them in monthly reports, and bring them to sprint reviews to show the customer “how well we’re doing”. How well you’re doing in an Agile project is measured by the business value you deliver and that can only be determined by your customer, not IT. Regular sprints of fixed lengths creates that predictability that is often missing in Waterfall projects where milestones keep slipping because of uncertainty with features that were estimated and planned months previously. If your team demonstrates value-added features at the end of your sprint and the business is on board to move to the next one, then you’re doing something right. And you’ll be hopefully able to more accurately predict the level of effort next time around.

    The Business Requirement Alignment Shuffle

    Shrubbery Requirements and business users change their minds. Especially after seeing results. It’s human nature. How many times have you brought that “perfect” tapestry home only to have your wife say “No, now that I see it on our castle wall it’s just not right. I want a shrubbery”. System solutions are the same thing and that’s fine. After a sprint ends, the business has every right; nay the privilege; to say what’s in or out next sprint. And heck they may even introduce brand new features as they see the system take hold and start dreaming up new stuff. This is *not* scope creep. It’s manageable expectations that are agreed upon by everyone once they understand the depth of the requirement.

    The Scrummerfall bing-bong alarm will go off if you’re in your 3rd day of the sprint and the PM starts picking and choosing from “other items” in the product backlog, substituting them in because of impediments. Avoid this at all costs. Features are not interchangeable like Lego. Even stories with the same number of points doesn’t mean it’s the same size. In situations where you’re not using story points or any kind of measurement system of feature/story size you’re in Scrummerfall land and cannot, under any circumstances, play the shell game with yet-to-be-determined-features.

    Business Driven

    In Scrum, the business drives the project by prioritization and commitment in order to help the entire team achieve some business value (which down the road should equate to some ROI). In Scrummerfall, the business just says “you pick what you need to do, propeller-heads, we really don’t care and will do our thing, you do yours”. A customer who’s not committed to the process but demands the project succeeds is an impediment. I think the biggest success factors in any Agile project is a fluid customer involvement. If you’re not engaging your customer, for whatever reason, then correcting that is Step #1 to success. IT cannot make business decisions. I’ve been on projects where we did, against my advice but forced by the PM, and when the client finally crawled out of whatever rock they were under, they took one look at the assumptions we made and blew 2 weeks worth of a teams work out of the water. Again, the powers that be, who only read Scrummerfall monthly reports, will chalk this up to Agile failure and blame Scrum.

    Engage the customer. They may not always be right, but, like any engagement, it’s a courtship and a democracy, not a dictatorship. There may need to be some hand holding at first and you might have to wade into the pool with them step by step, but it’s for the greater of the entire team and success of the project to do so. Or you could take the Scrummerfall approach and just push them off the cliff hoping they know how to swim (and maybe tossing them a life preserver if you’re really feeling generous).

    Peter Schuh has a great article here on 7 simple steps to go Agile without going extreme. It’s more geared for the nerds and developers, but there’s a great tip in a section called “Identify and collaborate with your customer”. That’s what this is all about.

    Know the Signs

    Knowing is half the battle and if you sense you’re on the slippage towards Scrummerfall (or are already knee deep in it) it’s time to sink or swim. Step back and get everyone involved to help identify what’s not working. If need be, stop the project and regroup. It might be to get some level of understanding in the requirements (or even the problem that you’re trying to solve) or get resources on track or whatever. PMs and other manager-types around the world are saying “Warning, warning, danger Will Robinson. We can’t afford to stop this project”. Frankly, you can’t afford *not* to stop it for a few days or a week at most. The entire team won’t be running flat out during this time but when things get back on track, the team should be better off. Don’t let this technological terror manage you and keep driving down the road with nobody at the wheel just to satisfy some planned delivery date. While you can screw around for the next few months/years on the project (and hey, some firms have all the fun because of unlimited funds) there’s little value in just doing stuff to keep busy.

    Killer_rabbit

    Adoption is a two way street and sometimes you’re going to face killer bunnies and sorcerers named Tim. It’s not pretty sometimes but Agile is about adaptability. Humans adapt well to their environment so should projects adapt well to theirs. If you’re setting out to change the world in one fell swoop, stop kidding yourself and be a little more pragmatic. If however you’re looking for a few small wins to move inches closer to an Agile approach to project delivery, it’s an attainable result given some realistic goals. Know your audience and your environment and play nice with the other kids.

    Waterfall is still valid today. Document, design, test, are all still there in every project. Practicing Scrummers (is that a word?) just do it in a different sequence.

    A bit of a side tangent. When I’m mentoring people on development, specifically refactoring, we do the refactoring manually and by the book. It’s painful in this day and age but it’s done for a reason, to help understand the meaning behind the refactoring and what each step of say an extract method is doing (and more importantly, why). After that, we can pull out the copy of ReSharper and accomplish the same refactorings with 1 or 2 keystrokes. I see Scrum the same way. Implement it by the book at least the first few times. Get into it, understand it and prove that it works. *Then* tweak it and massage it to better fit into your organization and how things may have been done in the past, perhaps grafting PMO processes, reports, and budget tracking into it.

    I don’t believe for a second that any organization out there can say “We’re doing Scrum everyone, pack up your PMI certifications and get rid of those silly monthly reports, we’re *Agile* now!” and drop everything. Even after learning and practicing it, they come to an understanding of what works and what doesn’t. If the team is geographically divided (with some members in different time zones for example) it’s impractical to have 8:30 AM stand-ups every day with everyone. Adjust to what makes sense to everyone.

    Agile is about adaptation and it can adjust itself quite well because it doesn’t follow strict rigorous policies that need to be approved by a committee and signed off by 15 heads of state before it can be followed. The Scrum approach is much like a morning brunch in a Dim Sum restaurant. You pick and choose what you like and ignore the chicken feet, no matter how appealing they may look like.

    It’s about what works for the team and the team has to discover that with practice and experience. If you only implement one or two practices (say daily stand-ups and a product/sprint backlog) and they work for you not against you, then good for you! You’ve taken your first step. However it needs a fighting chance to start. Wedging Scrum (or any Agile practice) in where it doesn’t belong is a bad practice in anyone’s books and not the fault of the process but the person trying to force it in. Don’t blame Scrum for bad choices you make.

    At the end of the day, whatever methodology, practice, or process you follow it needs to be backed by the new-but-old methodology, Common Sense. Agile is a powerful tool but not a religion. Scrum can be tailored for your needs, but you need to be able to identify those needs first before trying to apply any practice against them. Again, Common Sense reigns supreme here. There is no end-all methodology that will save any project from the depths of Hell. It’s the ability to identify, use, and adapt pieces of Agile that will help you to the end goal.

  • BlackBerry App Store, $200 do not pass go, do not upload application.

    I work on a BlackBerry app called DopeWars. It’s a silly little app and isn’t going to make me a world of money (it’s free and open source) but it’s fun and my diversion into the BlackBerry/Java world (as painful as the development environment is there, you think SharePoint is tough?). I keep on planning to write more apps but that unfinished project stack keeps getting bigger and bigger and something's gotta give.

    So I was all excited when it was announced that BlackBerry would follow in the steps of Apple and their highly successful App Store and offer a BlackBerry App World. Microsoft has done it with the XNA Creators Club and the business model seems like a good deal. Apple gets a cut of the retail price of your app but provides you with exposure and infrastructure. Frankly, the Apple people have it nailed. By sheer attrition, you can put a crap app out there for $2 bucks but with 100,000 people looking at it, you’re bound to make back the time it took you to slap it together. There’s a lot of crap out there and the crap pile just keeps on getting higher.

    In any case, they mentioned you could sell or give away your app on the BlackBerry app store. So here I had an open source app that was pretty popular and it would be nice to get some more exposure. Why not?

    Remember, this is coming from a guy who’s cheap like no other when it comes to handing out cash to guys that don’t need it. I don’t mind Apple or Microsoft gouging me for a percentage of my profits. They provide me with a service and in exchange I believe they get what is coming to them. I call it the George Lucas attitude to software development. George didn’t ask for a heck of a lot of money for Star Wars, he just asked for all rights to merchandising and let the film company in on a percentage of the profits. Future stars like Mark Hamill, Carrie Fisher, and Harrison Ford were given royalty cuts in the profits. And frankly that made them a boatload of money.

    So I’m no George Lucas, but I do feel that letting the big guy take a chunk in order to let the little guy survive is key. Indie developers are just that. Indie. Like independent recording artists, they don’t have a heck of a lot of cash to toss around for “studio time” so it’s done as a barter system. I’m quite happy to exchange a small percentage of profits with Apple for 10,000,000 users even remotely considering my app or being exposed to it. And here I thought RIM would be the same.

    Apparently not.

    As I waded through the myriad of agreements and checkboxes, I reached the elusive Step 3 of 4 for filling out the vendor application. No problem I thought. I’ve done this a million times before with Apple, Microsoft and others. Then I hit the wall. The cash grab. The money pit.Toy-Story-Little-Green-Men-without-claw-753073

    RIM wants $200 (USD) as an “administration fee” to complete registration. Yup. No $200, no passing go, no uploading free application to app store. Thank you, come again.

    WTF?

    RIM is a Canadian company and here they are asking for US dollarinos. First insult.

    You’re paying $200 for the “privilege” of submitting only 10 applications. Oh yeah, and that doesn’t actually mean you’ll get it approved. If it gets rejected (this is the good part) it “will be counted against your ten application submissions”. Second insult. Apparently RIM is the gatekeeper for apps and, like the Claw they decide who will go and who will stay. And it’ll only cost you $20 to find out.

    The final insult. The kicker. To upgrade an application it counts as a new submission against your 10. Yeah, that’s right kids. I create 2 or 3 versions of my application and submit it (assuming it gets accepted, no word on what the standard for acceptance/rejection is) and I’ve gobbled up 1/3 of my original 10 applications and essentially blown $60. Sure, you want to submit more than 10 versions or applications? No problem, we’ll kindly take your $200 again. Got rejected? Awwww. We’ll let you submit it again. It’ll only cost you $20 a shot.

    Frankly, this is the nerd equivalent of crack cocaine, but without the benefits.

    Okay, at the end of the day it’s your choice. I’m sure a lot of you are reading this thinking “What a jerk, don’t pay it then and stop bitching”. Don’t shoot me. I’m just the messenger and putting it out there for others that might think this new way of delivering apps is for them. Needless to say I’m passing on BlackBerry app store as far as being a vendor. I’m quite happy with my silly little app living up on SourceForge and the 10 users seeing it.

    Buyer beware, Caveat Emptor, and all that good stuff. Feel free to hand your coins over to RIM if you want, just understand that IMHO RIM’s BlackBerry version of App Store isn’t for indie developers. YMMV.

  • Windows Server 2008 Tidbit #3,627

    Feel free to mock me but I’m just a simple developer, your modern ways frighten and confuse me.

    caveman

    If you know me, I’m a command line junkie and I’m all for shortcut typing and trying to maximize the effort my fingers have to go through by typing less (no, this doesn't mean I use 3 character variable names). I’ll rarely type a full path when jumping around in a command prompt and use the tab key and “*” character quite aggressively.

    In any case, nothing like stumbling over a goofy little thing in the middle of the night as I’m setting up a new VM. I was currently setting up a new virtual network for some MOSS development and going through the motions of creating a new 2008 server, creating a domain controller, adding IIS, lather, rinse, repeat. As I was setting up the DC (using an IPv4 of 10.0.0.1) I accidently typed this:

    C:\Users\Administrator>ping 10.0.01

    (rather than the full address of 10.0.0.1)

    And surprisingly got this result:

    Pinging 10.0.0.1 with 32 bytes of data:
    Reply from 10.0.0.1: bytes=32 time=46ms TTL=128
    Reply from 10.0.0.1: bytes=32 time<1ms TTL=128

    Hey! Wait a minute. That’s not what I typed, I missed the last period (bet all your girlfriends say that?).

    Curiosity got the better of me so I tried variations:

    C:\Users\Administrator>ping 10.001

    C:\Users\Administrator>ping 10.01

    C:\Users\Administrator>ping 10.1

    All getting the same result. So now rather than having to plug in those extra few digits I can happily type 10.1 over 10.0.0.1 when doing stuff like this.

    Like I said, I may be slow on the uptake and most of the planet already knows this trick so go ahead and call me names. I’m just a simple developer, your modern ways frighten and confuse me.

  • Passion and Pride

    No, you didn't stumbled onto the beginnings of a new Jane Austen novel. It's been a heck of a long time since I blogged and despite being abducted by aliens for the last month, I'm back on the wagon again.

    Passion and Pride. These are two key attributes I follow in work. Lately I've been combing the streets for contracts and meeting with all sorts of interesting challlenges, people, and organizations. The one thing that comes up often is the question of values (both in life and work). When I'm talking to these people I emote a strong belief in passion and pride both in teams and a company itself.

    I have a deep passion in what I do. Whether it's building ginormus infrastructures in SharePoint or writing a single unit test. I enjoy what I do. I think it's important that you feel what you do is important and have a sense of passion behind doing it. After all, if you're not enjoying your work maybe you should consider going elsewhere? Or changing your environment to suit what you like. You are in control of your destiny. Someone once asked me (as a team lead) when I was going to send them on training for xyz product. I asked them why they haven't gone already and why they were asking me. I'm glad to send people on training if they want it, but I won't shuffle off a team to a week long course because somebody in the organization thinks they "need it". You know what you need and what you want. If you want to better your skills in .NET or Scrum or OO and find something out there you like (I highly recommend J.P. Boodhoo's course but not sure if he's still doing them) then by all means I will fight the good fight (if that's my job) to get you out there. The point here is that you need have passion in what you're doing. J.P. is one of the most passionate persons I know in the software industy and it shows.

    Don't get me wrong, you still need technical aptitude. Notice I said aptitude and not skill. Frankly, if you understand structured programming and can grasp the basics of good OOA/OOD there's not a single language or environment on the planet you can't learn. Skill is an attributed applied. I've always considered software an art. My background started in art, and IMHO building software is creation of a new piece of art. With creating art comes passion and you apply skill to hone your craft. When I first started sculpture in High School, I really didn't know what I wanted to produce. My teacher at the time was a great man who, rather than sticking to cirriculum, took his classes through every media known to man. Iron, wood, clay, etc. He wanted each person to find their niche. Their passion. If sculpture wasn't your cup of tea that's fine but at least you tried it. Maybe .NET development isn't your gig. Try something else. Another language perhaps. Or maybe your prefer the Linux platform to Microsoft. Or Apple. In any case, there's a sense of discovery that has to happen. You'll know your passion when you see it. Once you find it, land on it and hone your craft.

    The other side of the coin is pride. Again, whether it's a single unit test or an entire solution I try to take pride in what I do. I have a fault in that I'm a bit of a perfectionist so I'm always going back and tweaking something until it's "just right", but it never is. To me this is my continuous improvment technique. I hone my skill by practice, practice, practice and I reflect. When I look at what I've done (and while I'm doing it) I try to take pride in what I'm doing. Recently we had a discussion at a user group where the developer was presenting code he had written to solve a problem. The conversation dipped into things like writing good solid code, abstraction, re-usability, etc. One comment was that "it's only demo code" and that somehow forgave all the issues that I saw in the codebase. True, if you're doing a demo to present to someone you might skip some good practices. For example, not writing unit tests. This is probably the biggest thing I see and perhaps the easiest to accomplish. However I saw if you're building something for anything other than a spike (that you'll throw away) then take pride in your work. If the code starts to get ugly, think about how it might better be accomplished. Is there a pattern here you could use? A state pattern for example to remove an ugly case or switch statement? The biggest excuse will be "I don't have time to make it pretty, just make it work". I don't know how many times I've heard that but then years later come back and see that "ugly code" running a mission critical system.

    Take pride in what you do everyday and in everything. It'll reflect in your work and that day that it needs to grow, it won't be a "let's rewrite this correctly". It may take more time at first to "do the right thing" but please don't sacrifice good software practices for the sake of time. I personally have no issues going to a client to say "we can't deliver you xyz functionality in the given time/budget/resources but can give you x and y fully tested and reliable". It's a hard sell but one you have to make. Being proud of the work after the fact shows through it's lifetime and you'll be able to go back and *really* re-use what you've done rather than re-invent. On the flipside, like my perfectionist side, don't go overboard with pride. If you're truely under the gun for delivery take whatever measures you have to do meet those goals but do it smartly. Not every "i" has to be dotted and "t" crossed, but you also don't have to throw out entire modules because of shortcuts. It's a difficult balance but one that will come with time and patience.

    So bottom line. Be proud in what you do and have passion in doing it.

    Anyways, that's all I have to say about that. Welcome to 2009.

  • The Anti-Architect

    I'll come out of the closet for a moment as I become a little more jaded in life and bitter this holiday season. I'm an Anti-Architect. I'm all for software architecture as the alternative is let some guy who read "Teach Yourself SharePoint Programming in 24 Hours" unleash onto an Enterprise solution and then have some high priced consultant come in and clean up the mess (or the guy that created the mess *was* a high priced consultant and now you need an even higher one to fix the problem) but while I'm an Architmatech in some sense of the word, I'm also a developer at heart and a creator in essence. I'm a little bit Country, I'm a little bit Rock and Roll.

    I was looking over some of the dated material on Microsoft's Architecture Certification Program and found their role definitions here. One of the issues with the IT world is that MSFT publishes some white paper, document, or scans a napkin and IT managers flock to it like flies on dung, spouting as the Gospel and Word and declaring that everyone follow it blindly. If Microsoft wrote it, it must be right. Right? Maybe. Some stuff they get right, others they're way off base.

    Here are my top 10 reasons into what makes an Anti-Architect (for lack of a better term)

    1. Live, breathe, and eat technology through knowledge and experience every day. Just because you're labelled an "Architect" (big or small "A") get coding! Keep your wits about you with modern development approaches and open the door to new stuff.
    2. Don't make key technical decisons on a project when you don't know the day to day operations of system internals. Things change and the world doesn't sit around waiting for you to catch up. Keep sharp and be real about what is happening.
    3. I'm a propenent of minimalism and like to keep things as simple as possible. Playing buzzword bingo with your client just cause unnessary headaches for developers. Put your developer shoes on when talking architecture and think, what would I do in this situation?
    4. Negotiation is your key asset and skill. Use it wisely and strike a balance between technical complexities and business needs and decisions. You're no good to a team if you're sitting in an ivory tower spouting words of wisdom that favour the nerd in you. Don't be proud of the technological terror you're about to create.
    5. Perspective is prime and the world is a prism. Looking at things with blinders on just makes limited decisions and paints a team into a corner. Be open to suggestions from everyone and weigh those ideas against the goal. It's like the symbol of Justice (no, not THAT Justice) with the blindfold on. Any idea is possible until it's validated against the constraints that you might face. And even if there are constraints driving you down a path, stop for a moment and do a sanity check to see if the path is really forcing you to make decisions or you're the one paving the road.
    6. There is grand design and there is reality, and never the twain shall meet. Going back to simplicity and the YAGNI principle, try not to force some design pattern down everyone's throat. Keep repeating to yourself simple; change; stable and guide your decisions against them.
    7. Don't become the Bus Factor. If you get hit by a bus, can the system continue? Spread the knowledge and wealth and be transparent in decisons. While you might be positioned as the authoritive decison maker, input from the team is invaluable and needed to sustain the life of any software system.
    8. Design by committee doesn't work, but neither does the dictatorship model. Be the guiding driver behind decisions as you've apparently got the knowledge but don't decide in a vacuum. Key architectural decisions should be vetted with the team so not only you can be aware of scenarios you didn't think of, but the team is involved in the game.
    9. Filling out documentation for documentation sake is for the birds. My principle is to document what you need at the appropriate time of communication. If you have to present an idea to the team in order to understand it, that's when it might become concrete (whiteboard, Visio, code, etc.). Don't covet the world's knowledge in your head.
    10. Know your limitations and relegate to your peers when you're out of your league. Not everyone knows everything (unless your name is Scott Hanselman) so making decisions on say a SharePoint installation when you don't know SharePoint is just wrong. I call this the Life Preserver clause. Don't be afraid to call out to the lifeboat and have them toss you help when you need it.

    These are some ideas around being what I call an Anti-Architect. Use them as you see fit, YMMV.

  • Visual Debian Installation Walkthrough using Virtual PC

    I had to work on some code inside of a “real” *nix system recently so I though I would give everyone a visual walkthrough of setting up the operating system. I need to pave a new image so I figured I would just share with the rest of the class setting up a *nix system from scratch using Virtual PC. You can accomplish the same with VMWare, I just happen to be using Virtual PC for this.

    For the OS I chose Debian. Actually I have several unix images for this type of work (Linux, NetBSD, etc.) but I’ve always liked Debian. It’s a slick text based install and works quite well, right down to the part of being able to select only what I need. I found the other Unixes to be cumbersome getting setup sometimes and not very visually appealing (installing NetBSD is like watching Justice Gray do his hair).

    So here’s the visual walkthrough of creating your own Debian install using Virtual PC. This install was done with Debian 4.0R5.

    Pre-Install

    You’ll need a couple of things to get started. First your Virtual PC (or VMWare if you choose) to run the guest operating system. You’ll also need an ISO image of Debian. I used the 180mb netinst ISO image file to start. It’s larger than the 40mb version but the 40mb version doesn’t even include the base system so I saved the download by getting the larger image. You can get the image from this page here. Choose the i386 ISO from the first list of options on the page.

    Once you’ve got the ISO ready you can setup your Virtual PC image and start. Here we go.

    The Walkthrough

    From Virtual PC, select the “New Virtual Machine Wizard” from the File Menu:

    image 

    Click Next

    image

    Select “Create a virtual machine” from the options and click Next:

    image

    Give the virtual machine a name and optionally choose a location. I keep all my VMs on a portable USB drive:

    image

    Leave the operating system as “Other” and click Next:

    image

    You can adjust the ram if desired. I’m doing console development so 128mb of RAM is fine. If you want to install X-Windows or something then you might want to bump this up. It can be changed later so you can leave it for now and click Next:

    image

    Change the option to create a new virtual hard disk for you and click Next:

    image

    By default the new virtual hard disk is created where your virtual machine is created. This is fine and you can leave the default then click Next:

    image

    The confirmation screen will show you the options. Click Finish to create the new virtual machine. One more setting that you may need to change. Select the network adapter for the virtual machine to bridge to your host adapter. This allows Debian to obtain and IP and access the internet to download modules.

    image

    Your Virtual PC Console will show you the new virtual machine ready to start. Select it and click Start:

    image

    The new VM will boot but you need to capture the ISO image you downloaded earlier. Select CD from the menu and select Capture ISO Image:

    image

    Now browse to where your netimage ISO is located and select it then click Open:

    image

    From the Action menu in Virtual PC select  Ctrl+Alt+Delete:

    image

    Debian will now boot. Press enter to continue:

    image

    A few hundred lines of gobbly-gook will flash by until you arrive at this screen. Pick your language and press enter:

    image

    Choose your country next and press enter:

    image 

    Next choose a keyboard layout to use:

    image

    After a few minutes of loading screens you’ll be asked to provide a hostname for the system. Enter one and click continue:

    image

    By default the next screen will probably grab your ISP domain name but you can change it to whatever you want as this is going to be a local machine for testing. Enter a name and click continue:

    image

    More hardware detection and the disk partitioning starts. As this is a VM you can just select the first option and let Debian guide you through using the entire disk. Select that option and press enter:

    image

    Debian will find the 16gb hard drive the VM is showing (but it’s not really taking up 16gb on disk, well, not yet anyways). Select it and press enter:

    image

    The next option is how you configure the partitions. For *most* *nix installs I choose the 3rd option and split up my /home, /usr, and /var directories. However that’s usually on systems with multiple disks and again this is a test system right? Pick the first option to put all the files in a single partition and press enter:

    image

    You’ll be given one final chance to back out. Go ahead and press enter to write those changes:

    image 

    Tee hee. Fooled ya. There’s one more confirmation. They *really* don’t want you to destroy data (like I did years ago and lost the contents of a book I was writing, tell you about that over beers one day). Select Yes and go for it.

    image

    Partitions get formatted, the world is a better place and we’re onto the next step. Congratulations! You’ve reformatted your hard drive (well, your virtual one). Select a time zone so Debian knows when to move clocks around on you:

    image

    Next is the all important “root” password. This is a test system so choose the uber-secure password of “password”.

    image

    And you’ll be asked to enter it again:

    image

    Next you’re asked to setup a real user (rather than using root). While this is a test system, it’s like logging into SQL Server using “sa” and kind of feels dirty. Besides in the unix world you can actually accomplish things as regular users without being nagged by a UAP dialog and a simple “su” command let’s you become “root” again. Enter the name of your real user here and press enter:

    image

    Next you’re asked for an account for the user. Give it a simple name (no spaces) that’s easy to remember. For the hackers reading this, I always use “bsimser”:

    image

    Enter a password for your new user. Again, I chose to use “password” feeling that nobody would be able to guess it (I also considered “love”, “sex”, “secret” and “god” but thought was too over the top):

    image

    Debian now installs the base system. Go for a coffee. It’ll be a few minutes. Go on. I’ll wait.

    When you get back Debian will be asking you about mirrors. The netinst version has a base system, but it can (and should) leverage internet mirrors for files. It’ll do checks against the mirrors to get the latest versions and updated packages for you so it’s a good idea to say Yes to this option.

    image

    Once you’ve committed your soul to the installer, you’ll be asked to pick a mirror. Choose one in your own country to reduce the traffic sent around the world and press enter:

    image

    A list of mirror sites will come up based on your country choice (you did choose YOUR country right?). I’m not sure if the mirror list is sorted by access speed but whatever. Pick one as they’re all near you anyway. You might find a mirror doesn’t work during the install (nothing in life is guaranteed, including this walkthrough) so if you find it doesn’t work, Debian will bump you back to the mirror selection screen (this one). Pick another and try again. One of them is bound to work, eventually.

    image

    If you’re behind a firewall or proxy you need to let the package manager know this information in order for it to do your bidding. Enter it in the next screen:

    image

    Debian then downloads and configures the package selector. Next step is the dreaded “tasksel”. This is sort of Linux for Dummies where you tell it you want a desktop, or web server, or SQL server and it picks the packages for you. Frankly, I *always* avoid this step. I like to get a clean system up and running *then* decide what I need to install on it. Also, as this is a VM you can just copy your clean system and have lots of little VMs running around with different purposes. If you choose a configuration here you are on your own, I cannot follow you on that path. However I recommend deselecting everything here and pressing Continue. We can install packages later.

    image

    Next Debian will ask you if you want to install the GRUB boot loader. As this is the only OS on the system let GRUB do it’s thing and install to the master boot record.

    image

    That’s it for this part. Before you reboot, release the CD ISO image by choosing the option in the CD menu of Virtual PC. Now press Continue and hold your breath.

    image

    More gobbly-gook and you’ll be at your Debian login prompt. Login as your regular user you created previously:

    image

    If you’re really lonesome for that DOS feeling type ‘alias dir=”ls –l”’ at the command prompt after you login. You’ll be able to type “dir” now and it’ll look *kind of* like your old world.

    Now we have a bare-bones system. You don’t have an ftp client or a telnet client or any developer tools! Let’s fix that.

    All (most?) unix systems these days have some kind of packaging system that allows you to get all these extras. It’s like a big warehouse of software just waiting to install to your desktop. Debians is called APT. There’s an entire HOWTO here on it if you want to get all down and dirty with it. APT is your friend. Learn it, live it, love it.

    For example type this at the command prompt:

    su<ENTER>

    Enter your root password

    apt-get update<ENTER>

    You should see something like this:

    image

    The contents will vary as these are from my mirror but basically it just updates the catalog of “stuff” you can get. Now (while still impersonating the root account) type this:

    apt-get install ftp<ENTER>

    You’ll see a result similar to this:

    image

    Remeber when Trinity needed a pilot program for a military M-109 helicopter and in a few seconds Tank downloaded it to her? Well, you can now type in “ftp my.favorite.porn.site” and get there instantly (or as fast as your internet connection will take you). Cool huh?

    I prefer the APT command line but it takes some getting used to. There’s also a tool called “dselect”. While still running as root, type “dselect” and you’ll eventually get to a screen like this:

    image

    It let’s you pick a package to install, provides a description of it, and let’s you install it but just selecting it. Type it in using the apt tool or pick it using this one. Your choice.

    That’s pretty much it kids. By now you have a fully working Debian image you can clone. Use the APT tool to install your favorite tools and get to work and hope this lengthy blog post filler helped.

    Enjoy!

  • 9 Options, 4 Icons, 1 MessageBox

    You know there are things in life that you never notice or worry about. This is one of them.

    The MessageBox API in Windows Forms allows you to specify message box icons to display along side your all-important message you're communicating to the user (System Error, Hard Drive Full, Your Cat is Pregnant, that sort of thing). Icons can help add a little punch to an otherwise drab afternoon staring at rows and rows of spreadsheets and overdue time cards.

    The 9 options you can select from to kick your otherwise drab battleship gray business application up are: Asterix, Error, Exclamation, Hand, Information, Question, Stop, Warning, and None. None of course presents no icon. The others provide you with an icon that matches the description. Or does it?

    Here's the Asterix option:

    clip_image002

    And here's the Information option:

    clip_image002[5]

    Hmmm... something isn't right here. Am I seeing double? No, both options use the same icon.

    Onto the Exclamation icon:

    clip_image002[7]

    And the Warning one:

    clip_image002[9]

    Hey! You're copying and pasting the same image!

    No friends, I really did write a program to do all this (contact me for licensing and source code rights) and they really are different.

    Finally here's the Error, Hand, and Stop icons (all conveniently wrapped up in one picture):

    clip_image002[11]

    Yup. All three use the red 'X' icon. You would think, oh I don't know, the Hand would display a Hand icon and Stop might, oh what the heck I'll take a stab at this, display a Stop sign. Now I'm all for saving on resources. After all, icons cost money to make; take up valuable bytes in the CLR; and lord knows how many hours of debate over the right shade of yellow for the Warning icon was spent. However if you're going to provide a programmer 9 different options (which all seem reasonable and unique) then why would you only provide 4 icons (I neglected to show the Question icon which is indeed a question mark). Did the MessageBox team have their budget cut or something?

    In any case, this seemingly random blog entry has been brought to you by the letters M, M, and M and the number M.

  • The First Spec You Should Write When Using Castle

    Thought this might be useful. On a new project where you're using the Castle Windsor container for Dependency Injection, this is a handy spec to have:

    [TestFixture]
    public class When_starting_the_application : Spec
    {
        [Test]
        public void verify_Castle_Windsor_mappings_are_correct()
        {
            IWindsorContainer container = new WindsorContainer("castle.xml");
            foreach (IHandler handler in container.Kernel.GetAssignableHandlers(typeof(object)))
            {
                container.Resolve(handler.ComponentModel.Service);
            }
        }
    }

    It doesn't guarantee that someone missed adding something to your configuration, but this way anytime someone adds a type to the configuration this will verify the mapping is right. Very often I move things around in the domain into different namespaces and forget to update Castle. I supposed you *could* use reflection on your assembly as another test and verify the mapping is there, but not every type in the system is going to be dependency injected so that's probably not feasible.

    Thanks to the Castle guys for helping me get the simplest syntax going for this.