try-catch-FAIL

Failure is inevitable

NAVIGATION - SEARCH

SQL Server Tip: sqlcmd variables

Here's a fun little tip you can use in your SQL scripts to make them scriptable via the sqlcmd utility while still supporting SSMS.  Say you want to make the name of your database configurable so you can script out the deployment of your database.  You could do that with a script like this: 1: SET @dbName = '$(DBNAME)' 2: ... 3: EXEC sp_executesql 'CREATE DATABASE [' + @dbName + ']' 4: ... But what happens when someone decides to run your script in SSMS?  It will try to create a database named '$(DBNAME)'!  That's not e... [More]

Time to stand up...

I never intended to use this blog as a political soapbox, but here we are.  I will at least keep this short.  It's time to stand up.  It's time to push back and tell those that are supposed to represent us that we're not going to let them rob us.  That's all I'll say, for more, go checkout Wired.

Web.config magic: configSource and file attributes

Many of the web applications we create are deployed many different times, providing many different instances.  Each instance is slightly different, but only in terms of configuration: they use different databases, possibly different sitemaps, different themes, and different terminology (via resource files).  Aside from those things though, the applications are exactly the same.  We want to be able to refresh deployed systems quickly and easily without having to do a lot of manual file manipulation.  In this post, I'll discuss how we addressed the problem for one specific so... [More]

Interesting observation: C# vs. Ruby

CodeClimber has a neat post on how searches on C# compare to searches on Ruby.  C# is clearly getting more searches (even before you factor in all the various ways people search for C#), but the difference is much more pronounced during the week.  Maybe all us C# devs are getting burned out by the end of the week and aren't doing much hobby developing on the weekends?  Or maybe the ones doing hobby development aren't having to run to Google as often for answers as the peeps doing 9x5 development (no disrespect intended, there's nothing wrong with Googling for answers instead of ... [More]

How to run a software development company (INTO THE GROUND) - Part 6

Oh yeaaaaaaah! It's Friday, and even though I'm busy as all get-out (which is actually related to today's HTRASDC article), I'm going to bestow  the greatness of my writing upon your face.  Enjoy! Do everything at the last minute Failure to plan == planning for success, or at least that's what I've heard from this homeless guy that I pay to wash my car every other week.  If there's one thing I know for sure, it's that planning is a complete waste of time.  As we have established, your software developers ... [More]

Machine Learning: Why you should care

In the last post, I introduced the topic of machine learning.  In this post, I'll describe an example problem, discuss how you might go about writing code to address the problem, then discuss how you can apply machine learning to the same problem and get the computer to do the heavy lifting for you.  In the end, hopefully you'll at least have a vague idea of how machine learning might be useful. The problem You work for a company that makes data entry software for hospital emergency rooms.  One day, your boss comes in and says that you're going to add a new feature to the soft... [More]

Why var is a very important keyword in a recursive JavaScript function...

I actually don't hate JavaScript.  I'm typically not a fan of duck-typed languages, and JavaScript has caused me no small number of headaches, but it has its uses, and it beats the alternative.  I could be writing in VBScript, after all... Still, there are a few things about JavaScript that really, really tick me off.  One of those just bit me badly this morning.  Take a look at the following block of code: 1: //Recursively sets the nodes and their children to the 2: //specified checked state. 3: function UpdateChildren(nodes, checked) ... [More]

Peer Reviews

Peer reviews seem to be a source of seething hatred for many developers.  I can sort of understand why (no one likes rocks being pitched at something they created), but they can actually be very beneficial if done correctly.  This post will lay out the case for doing peer reviews as well as an approach to performing reviews that I happen to like (stolen from my friend, 'Poprythm').  If you have any suggestions for ways to improve this approach, please share in the comments!  Also, if you're not doing peer reviews, I'd like to hear why. Purpose ... [More]

What is Machine Learning?

I'm going to be doing some posts on machine learning, artificial intelligence, and data mining over the coming weeks and months as I try to crank out a thesis.  Since machine learning isn't a topic that a lot of developers are familiar with, I decided it would be best to write up a brief summary of what machine learning encompasses and why you should care.  If you have any questions after reading this, please let me know in the comments.  I need to be very solid at explaining machine learning to an uninformed reader if I'm going to crank out a decent thesis... Machine learning,... [More]

How to run a software development company (INTO THE GROUND) - Part 5

Damn, we're at part five already?  You might think that I'd be running low on material by now, but fortunately I have witnessed a horrifying number of ways in which people have tried to run a software project, most of which ended in disaster.  This week we're going to touch on something that I'm still dealing with at least once a week... The OMFGWTFBBQ Method of Bug Triage Because the people working for you are software developers, the people working for you suck.  You know this is true because I have a blog and I just wrote this.  Because the people working for you suck,... [More]