Friday, March 26, 2010

Perhaps someone can explain this to me

Let's start with this:
http://factcheck.org/2010/03/a-final-weekend-of-whoppers/

I'm glad to see a low-bias, honest presentation of the facts. One fact, though, that I don't see emphasized enough (here and in a lot of other places) is this: "mandating that individuals buy coverage". Why is this okay? Why would this not be seen as an outrageous affront to my personal liberty?

I've heard that if one does not accept the mandate, one must pay a fine, a non-insurance fee. The rest of this rant is based on the quite possibly false assumption that this is true.

Consider this. Let's say I give you the following choice: either you
1- chop off one of your feet and I give you a magical golden blanket that keeps you from getting sick (maybe); or
2- chop off one of your toes. You get nothing in return and your toe goes into a pot to help pay for other people's magical golden blankets.

Now, nevermind which option you choose- you can decide on your own time and keep that to yourself. What I want to know is:
Is it a good thing that you are being forced to make this choice? Hypothetically, am I a good person for forcing this choice upon you?

I'm sure I'm missing something here and I'd greatly appreciate someone telling me what it is, please. I'm honestly curious. If I'm not missing something, then I'm just baffled.

Wednesday, March 17, 2010

Set with Select

Today's forehard slap is brought to you by the following:

This is a perfectly valid syntax for setting a local variable using SET which gets its value from a SELECT:
set @VAR1 = (select var1 from table1 (nolock) where var2 = @var2 and var3 = @var3)

This will bring your company to a grinding halt and leave everyone breathing down your neck till you fix it:
set @VAR1 = select var1 from table1 (nolock) where var2 = @var2 and var3 = @var3

Be careful to note and recall the difference.

Thursday, March 11, 2010

Today I learned a little about robocopy and exit codes

So, not satisfied with the old DOS command "copy", I decided to step it up a notch and start using robocopy. This way, instead of overwriting the same files every time I rebuilt my solution in VisualStudio, I could skip over those and only update the files that had changed. And there was much rejoicing.

But lo, this tale would have ended much too soon and boringly if that was all there was to it. No, unlike copy, robocopy has the added bonus of exitting with a non-zero value when actually copying a file (and when not copying a file: either returning zero or not returning anything at all- it looks the same to me). VisualStudio interprets any non-zero exit code as "FAIL!". So, digging around, I found the way around this: in the bat file with all the robocopy calls, make the last line something other than a robocopy call, like: echo "Done."

Done. Yay!