Sunday, April 4, 2010

Heh

Working with XSL right now:

<xsl:choose>
<xsl:when test="1=1">
1=1
</xsl:when>
<xsl:otherwise>
1=2
</xsl:otherwise>
</xsl:choose>

prints out 1=1.
But

<xsl:choose>
<xsl:when test="a=a">
a=a
</xsl:when>
<xsl:otherwise>
a=b
</xsl:otherwise>
</xsl:choose>

prints out a=b.

So, a does not equal a, eh?

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!

Sunday, February 28, 2010

Code Coach

Regarding the state of the economy- a lot of what sucks about it right now is the bursting of the housing bubble, which has resulted in housing construction to dry up. What could really help get things moving again would be if someone were to make a program that was a graphical user interface for the housing code, something that translates from architectural regulation language to layman talk.

Oh look, a friend of mine did just that:
http://www.codecoachresidential.com

Definitely worth checking out if you're considering making some home improvements anytime soon.

Friday, February 12, 2010

British libel reform petition

(a) British libel laws have been condemned by the UN Human Rights Committee.

(b) These laws gag scientists, bloggers and journalists who want to discuss matters of genuine public interest (and public health!).

(c) These laws give rise to libel tourism, whereby the rich and the powerful (Saudi billionaires, Russian oligarchs and overseas corporations) come to London to sue writers because British libel laws are so hostile to responsible journalism. (In fact, it is exactly because British libel laws have this global impact that we welcome signatories to the petition from around the world.)

(d) Vested interests can use their resources to bully and intimidate those who seek to question them. The cost of a libel trial in England is 100 times more expensive than the European average and typically runs to over £1 million.

(e) Three separate ongoing libel cases involve Simon Singh and two medical researchers raising concerns about three medical treatments. They face losing £1 million each. In future, why would anyone else raise similar concerns? If these health matters are not reported, then the public is put at risk.

Sign the petition

Sunday, February 7, 2010

A little story about MetroPCS

So, last year from about February till around September I was on MetroPCS. I was content with their mediocre reception, but was always irked that while on the 45 $/month plan, I was actually paying around 52$ and change with taxes and fees. Then I saw that Boost's 50 $/month included taxes and fees. So I gave Boost a try and was again sufficiently satisfied.

Then this past week I notice that MetroPCS is advertising a plan 40$/month, taxes and fees included, with everything I want. Be still my beating heart, they know how to win me back. So Saturday, I return to MetroPCS. (The lovely sales rep who helped me get reconnected was very pleasant, by the way.) Then this morning, today, Sunday, I wake, try to make a call and get a "You have insufficient funds" message. How odd.

I take my phone back to the store with my receipt and am told that while I ordered and paid for the 40$ plan, the system actually has me on the 45$ plan, which is really weird because I was able to make and receive calls yesterday no problem. The guy who is helping me now asks his neighbor coworker who did this. His neighbor tells him who and wonders aloud why she did that. I notice him, the guy who's helping me murmur "I know why..." One mississippi. Two mississippi. Three mississippi. Ok, the suspense is killing me: "Why was that done?" I ask.

I won't forget what he said. Clearly I remember him saying "It's a confidential company policy."

Excuse me?! You mean there was a reason why I was overcharged? This was done intentionally, causing me miss calls for half a day, and making wait in line in this cramped crummy store for half an hour for this terse explanation? Whatever could this secret policy be? It couldn't be that there is a plan to get customers back in a store in the hope that they might buy some more stuff, could it? I try to get some clarification, but of course, it being confidential, get nothing. Just a "Okay, you're all set. Have a nice day."

Oh, MetroPCS. Alas, this rekindling of our love was so brief. Back to Boost I go.