Interesting Search Results

I've been doing some coding on the side, and the first thing I do whenever I run into a problem or question is type as much of the original error text into a search engine. So I was chugging along recently, and I was looking at the SQL Profiler, and saw a lot of 'exec sp_reset_connection' in there. I was wondering if I was doing something wrong, so off I went to live.com (http://search.live.com/results.aspx?q=sql.server.profiler+exec+sp_reset_connection&src=IE-SearchBox):

  • Search: "sql.server.profiler exec sp_reset_connection"

1 result.

Uh oh, maybe it's time to alter the search terms. But that brief sentence after the stored procedure name looks promising. Let's go to the video tape!

Examining SQL Server Trace Files: http://www.sqlteam.com/item.asp?ItemID=24658

If you're using connection pooling you'll see lots and lots of calls to sp_reset_connection. Typically you'll see one before each SQL batch or stored procedure. ODBC and OLEDB use this to reset a connection before it's "passed around" in the connection pool. Gert Drapers has a good description of what sp_reset_connection resets. Basically I'd just ignore this in the trace (which is what I do in ClearTrace).

Wow. Exactly what I wanted.

For the curious, I also ran it against Google (http://www.google.com/search?q=sql.server.profiler+exec+sp_reset_connection&rls=com.microsoft:*&ie=UTF-8&oe=UTF-8&startIndex=&startPage=1) and came up with 7 results, with the above link being the first. Odd part is that none of the rest of the links answered any of my questions and in fact are just distracting.

Dumb Programming Advice

ASP.NET Potentially Dangerous Request.Form Value

My app threw this error the other day, and every piece of advice in the world said "here's how you turn this off!" Um, isn't this like turning off your brakes because they "make noise when you slow down"?

Here's how to fix it... any place you are outputting values directly from a DB or user input, it needs to be encoded.

MyCoolTextbox.Text = HttpUtility.HtmlEncode(your variable here);

Reasonable Portion Sizes

Really cool story on Digg:

200 Calories

I love this because it just goes to show how totally out of whack our ability to understand how much a normal sized amount of food is. When you go out to a restaurant and they serve you a giant plate with a giant pile of food on it, that is so much more than you actually need to eat it's not funny. If you did nothing more than bring a plate around with you that was of reasonable size and ate all your food off it (throwing away or refusing anything that didn't fit on the plate), you'd make huge progress.

Old Capitalism Poster

Heh, I love this. Bashing capitalism is so early 20th century. I wonder what all those people would have thought if they saw how corrupt Communism ended up being (not that capitalism is corruption free...)

Thanks Reddit. BTW, is it just me or is Reddit basically worthless? It's just way way way too brief.

Bloglines and Discoverability

I saw a friend of mine a couple of weeks ago and he properly called me on not using Bloglines any more. Not sure why I left it, but I've found my way back. I was working my way back in and wanted to see about actually using these nice hot keys. Anyone want to tell me why I needed to go to LifeHacker instead of Bloglines Help FAQ to see what they all are? Are you implying that the keyboard shortcuts are NOT frequently asked questions? I'd love it if they let me edit them, largely because they're designed for the QWERTY keyboard (which I do not use).

Note to Self: Ready More Graphic Novels

Remember when Graphic Novels were called Comic Books? Anyhow, there are a lot out that sound really good, I thought I'd make a list here:
  • "Sandman" series by Neil Gaiman
  • "Watchmen", "From Hell" (about Jack the Ripper) and "League of Extraordinary Gentlemen" by Alan Moore
  • "Blankets" by Craig Thompson - Teenager falling in love for the first time
The middle one has got to be my starter. I liked, but did not love, both those movies... I bet the Comic Books^W^Wgraphic novels are much better.

D

Classic Fallacies

Have I told you how much I love math? Here's a page that made me want to quit my job and go teach it:

Classic Fallacies

View all the wonders of the mathematical world! See a proof where 1=2! Observe a proof showing that all people in Canada are the same age! Any many more items that will blow your mind!

I love this stuff.