Wednesday, December 8, 2010

TechDays Follow Up

After my presentation on Build Automation with TFS 2010 this week at TechDays I was presented with a few questions that I didn't have a great answer for at the time. So guess what? I've dusted off the old blog! This kind of feels like a big comeback concert for a retired musician, only if instead of conjuring images of a Led Zeppelin or Eagles reunion, it's a little more like some dude that played in local bars on open mic night in his 20's getting drunk at his son's wedding social and playing with the live band for 25 minutes before throwing up a little on his guitar strap and being kindly asked to sit down.

Anywho, lets talk business.

Question the first: Where can I find documentation on existing 2010 build activities?
Answer: You can't. Seriously, lame as this answer is, from what I understand there is no documentation to be found. Sorry.

Question the second: Is there an activity to deploy a website to IIS?
Answer: The answer is technically no, but you can do this via MS Deploy and then add some build arguments to kick it off. Check out this post which describes the process in pretty solid detail.

Question the last: What is the link to Ewald Hofman's blog post about creating custom activities that you failed to walk through because you forgot you had no internet connection?
Answer: You can find the specific post here, which is one of a series of great posts on customizing team build.

And that's it! This has been kind of fun, and makes me want to revive the blog a little, but I'm not making any promises. If you really feel like you need a little baboon in your life, check me out on twitter (@codebaboon).

Friday, November 13, 2009

MSBuild + XMLUpdate + XPath + Namespaces

Today I came across an issue trying to use an XMLUpdate statement against the web.config in our team deployment build, and while the Googling did end up helping me resolve the issue, it didn't turn up any direct results that really showed/explained what I needed to do. So what would Brian Boitano do? Well, besides using his magical fire breath to save a maiden, he'd probably decide to dig up the rotting corpse of his blog and fill the void himself. So here we are!


Anyways, check out the relevant chunk of my config file (sensitive info obfuscated, of course):

xml version="1.0"?>

<configuration>

...

<openaccess xmlns="http://www.telerik.com/OpenAccess">

<references>

<reference assemblyname="OurAssembly.Name" configrequired="True" />

</references>

<connections>

<connection id="OurDatabase">

<databasename>OurDB</databasename>

<servername>.\SQLEXPRESS</servername>

<integratedSecurity>True</integratedSecurity>

<backendconfigurationname>mssqlConfiguration</backendconfigurationname>

<connectionParams></connectionParams>

</connection>

</connections>

<backendconfigurations>

<backendconfiguration id="mssqlConfiguration" backend="mssql">

<mappingname>mssqlMapping</mappingname>

<logging.logEventsToTrace>False</logging.logEventsToTrace>

<logging.logEvents>verbose</logging.logEvents>

<lockTimeout>5000</lockTimeout>

<logging.logEventsToSysOut>False</logging.logEventsToSysOut>

</backendconfiguration>

</backendconfigurations>

</openaccess>

...


</configuration>

As you can see, we're using the Telerik OpenAccess ORM tools. My goal was to insert some values into the connectionParams node specific to our deployed application scenario, so I originally had a statement in the team build proj file that looked like this:


<XmlUpdate XmlFileName="%(WebConfig.FullPath)"

XPath="//configuration/openaccess/connections/connection[@id='OurDatabase']/@connectionParams"

Value="AttachDbFileName=$(DropLocation)\$(LabelName)\$(Configuration)\_PublishedWebsites\$(WebProjectName)\OurDB.mdf" />

Unfortunately, it didn’t work. After some digging I discovered that the xmlns attribute on the openaccess node messes with XPath, and that I could use a Namespace attribute to help solve that problem, but nothing really showed how exactly to do it. I used a little trial and error and came up with the solution as seen here:


<XmlUpdate XmlFileName="%(WebConfig.FullPath)"

Prefix="n"

Namespace="http://www.telerik.com/OpenAccess"

XPath="//configuration/n:openaccess/n:connections/n:connection[@id='OurDatabase']/n:connectionParams"

Value="AttachDbFileName=$(DropLocation)\$(LabelName)\$(Configuration)\_PublishedWebsites\$(WebProjectName)\OurDB.mdf" />


So as a way of explanation, we define the namespace we're hunting for and assign it a prefix. Then, in the XPath, we use the prefix for any node that falls within that namespace, but not for the nodes before it takes effect (such as configuration).


All of this info is out there on the web in pieces, and I'm sure smarter folks than I can put it together quickly and move on, but hopefully this post will help the other goobers like me who would otherwise take an hour or two to put all the pieces of the puzzle together.


Faithfully yours,

Code Baboon

Friday, May 29, 2009

Inspiration Ain't No Dime-Store Booty Call

If there is something I've learned over the 30-some years I've sullied this planet with my presence, it's that creative inspiration is not your average mistress.

You see, your average mistress is just a 7 digit SMS away, always lustily awaiting your poetic summons. "Motel 6 rte 53 7pm smel good". As you pull up to that grungy roadside inn, 10 minutes late and whiffing of stale rye, you can be certain that your average mistress is patiently waiting inside, ready to get the business. 25 minutes and one step closer to hell later, your average mistress will blissfully watch you leave, reassuring you all the while that she really doesn't mind taking the city bus to meet up. It's only one transfer, and besides, it gives her uninterrupted time to think just of you.

But inspiration... inspiration is a much different creature. Inspiration flits around the edges of your mind all day, but never heeds your call. Inspiration does not arrive at a time of your choosing, but rather taps incessantly on your bedroom window at 2:45am while you lay beside your gently sleeping betrothed. At times inspiration will disappear for weeks, even months, nowhere to be found. There is no note, no phone call, no "Gone to Cancun, back next week with pics" text message. Simply an empty void where something important should be. No, inspiration ain't no dime-store booty call.

So, what to do when inspiration comes knocking, awkwardly thrusting it's heaving bosom of creativity in your direction at the most unworkable of times? Do you risk turning it away, spurning the unique joy and passion that only inspiration can provide, perhaps not to see it again for what may seem an unlivable period of time? Or do you drop what you're doing, hand your 5 year-old child a $20 bill and say "I've got another one of these for you if I don't see you for the next hour", and harken the call of your supple muse?

Ultimately, it's your call. But perhaps the most vexing attribute of inspiration is that even when you welcome it and embrace it, even as you relish awash in the waves of sheer beauty emanating from it, and often just as you are certain you are experiencing the most climactic of surreal epiphanies, even with all that, time and again it will simply vanish, and your handiwork is left unfini-

Tuesday, May 19, 2009

Too. Much. Fun

I've been blessed with a new laptop here at work, and so over the last week I've slowly been transitioning to it. Today I went to open a PDF document and realised that I had yet to install a PDF Viewer. Now, I've long hated Acrobat Reader due to it's terrible load times, and a few years back discovered a much better option in Foxit Reader. However, I felt it might be time to take a quick look at the PDF Viewer landscape and see if anything else might have popped up that I could try out.

As luck (or Google) would have it, I came across some positive feedback regarding something called PDF-XChange Viewer. Normally a name that lame is enough to turn me away, but the good feedback I read convinced me to at least check it out. So I went to the download section and saw that they had both a regular version and a 'portable' version. Curiously, the portable version was for normal Windows systems, not mobile systems as I had initially expected, so I was interested to see what the feature differences existed between the two. Luckily, there is a link to a feature comparison, as seen here:
This is where the awesome kicks in. Clicking that link yields the following gem:

Yes, that's right: in order to adequately judge which PDF Viewer to download the user must first have a PDF Viewer installed. Genius! Too bad there isn't a handy document format that this information could have been stored in which would have allowed people to view the information without requir--- WHY THE DEUCE IS THIS CHART NOT HTML?!

Sunday, December 7, 2008

Hot Dog

While my wife and I were on vacation, my parents were kind enough to take care of our Old English Sheepdog, Molly. They live out in the woods near Kenora, so this is a real treat for Molly because she can run free out there; plus, my parents are retired and home during the day, so she isn't alone as much.

Now, life with Molly is always a bit of an adventure, so when we got back from Hawaii we called to ask how things were going, and sure enough my parents had a lot of stories to tell. Most of them were pretty typical Molly stories (running directly at oncoming vehicles, licking one of my dad's leather slippers so thoroughly one night that it is now hard as a rock since it dried out, and general tales of her legendary clumsiness), but one story truly stood out.

As the story goes, one night shortly after we left, my parents were relaxing in the house watching TV. As with most dogs, Molly likes to be wherever the people are, so she was lying in the room with them, off near a wall. As they all sit there, my dad begins to pick up the scent of something unpleasant. Now, Molly is well known for her profound ability to light up a room, so to speak, so assuming Molly has just let loose, my dad continues to watch TV in hopes the smell will soon dissipate.

As the minutes pass, however, the smell not only remains, but it strengthens. And it doesn't smell quite like gas... it smells like burning. So my dad starts to look around for a fire. He wanders out to the kitchen, around the house, looking for the source of the smell. Nothing seems out of the ordinary, but the smell is still there. As he is doing this, Molly goes to the back door and waits to go outside, so my mom lets her out.

Over the next few minutes they continue to look around for the source of the smell, but nothing seems amiss. So they resume watching TV, and sure enough the smell starts to lessen.

Later, Molly barks to come inside. As my dad lets her in the door, he discovers the source of the smell: all down one side, Molly's fur is a nice burnt orange. It seems she was sleeping next to an electric baseboard heater, and her fur must have pushed up against the heater coils and caught fire. Luckily she didn't go up in flames, but rather the fur must have smoldered for awhile, causing the smell. It seems that she never even noticed, and most likely just went outside to either avoid the smell, or because she was feeling a bit on the warmish side... likely from being on fire!

Looking at her now, about 2 weeks after the incident, the burnt fur isn't very noticeable, although it does cover quite a large patch of her right side. My dad says that for the first few days it was very obvious, and that everyone who saw her immediately asked what she'd gotten into, or why her fur was discolored. So he would have to tell them the story of Molly catching on fire, and most listeners would respond by telling him that he'd better trim the fur off and pretend that nothing happened if he ever expects to be able to watch his soon-to-exist Grandchild.

All I can say is, he's going to have to try harder than that if he wants to get out of babysitting.

Friday, December 5, 2008

Lots to talk about, so little time

I can't believe all the stuff that's been going on that I haven't blogged about! Obama is on his way to the White House; our own politicians back home are acting like children at best, idiots at worst (and I mean all of them, Harper, Dion, Layton, the whole lot); I spent 10 days in Hawai'i; I did a presentation on WPF Data Binding at the Microsoft Tech Days conference here in Winnipeg; and many more little things that I've been itching to spew opinions on. Oh, and my wife is 7 months pregnant.

Unfortunately, life has been a bit of a maelstrom and I just haven't taken the time to nurture this web site. Hopefully this post will be the beginning of the renaissance here at Chez Code Baboon.

So, with all the amazing things happening right now, what am I going to talk about first? A petty annoyance with a technology, of course!

At Tech Days everyone received a free copy of DVDs containing videos of every presentation from Tech-Ed 2008. I was pumped, so this evening I plopped a DVD into my computer and got ready to see what all was on there. There is an absolute boat-load of content, so MS has provided a Silverlight app to allow you to search and discover the content and figure out what disc it will be on.

Sounds great, right?

Well, it would be if the app on the DVDs wasn't written in Silverlight 2 Beta 2. You see, I like to stay current, and Silverlight 2.0 RTW has been released so that's what I have installed. You'd think the final release would be able to handle running an app written in Beta 2 of itself, right?

Nope.

That's right, the DVD tells me I need to install Silverlight (specifically Silverlight 2 Beta 2). It provides me with a link to the Silverlight download site, but that site kindly informs me that the page I was redirected from is running an old version of Silverlight and needs to be updated to the latest version. Seriously, check it out (you may need to click the image to see it in full size to read the hilarious text in green):


Kinda hard to update something burned onto a DVD.

I tried to uninstall Silverlight and follow the link again, but it just had me install the 2.0 release again (since it is the latest version, after all). In order to actually view the content on those discs, I ended up having to Google search for the Beta 2 bits where I eventually found them on some filehippo site. I downloaded and installed it anyways; I mean, if you can't trust filehippo, who can you trust? Of course, the upshot here is that I now can't view any Silverlight sites written for 2.0. Sweet!

I've noticed problems like this before with Silverlight apps. It seems like there are about 25 different versions of the Silverlight framework out there, and none of them can view apps written in older or newer versions than themselves.

MS needs to sort this crap out; this is not the path to becoming the Flash/Flex Killer they aim to be.

Friday, October 10, 2008

New And Improved

When I began this blog, the idea was, ostensibly, to create a little corner of the interweb where I could espouse my views on the various and sundry details of software development, hopefully providing some useful information with a dusting of humour to keep things moving. Sure, a handful of posts strayed from the premise, but for the most part I tried to stick to my guns and not litter the site with pages of unrelated fluff. In my head I always wanted to maintain a ratio of at least 1:1 between crunch and fluff, as it were.

Unfortunately, what I've discovered is that there are long periods of time when, for various reasons, I have nothing relevant to add in regards to crunch. So what happens is that I end up posting nothing at all, because I don't want the blog to become overly fluffy. But you know what's worse than a fluffy blog? A dead one

So from here on out, the shackles are coming off. I'm going to post about whatever I feel like; be it sports, politics, arts, or anything else. Hopefully we'll get the odd software post mixed in, if for no other reason than to keep the name at least borderline relevant. But there are no promises.

So let us all raise our cups to the new and improved Code Baboon Blog!


... By the way, I'm virtually clinking glasses with all of my imaginary readers right now, and it's totally awesome.