I’m not one to post a lot of quizzes on my blog. Let’s face it, while we may create altruistic reasons for posting quizzes such as:
It’s an interesting problem I thought up
It’s an interesting bug I ran into
we all know the real reasons for posting a quiz.
It serves as blog filler.
It’s a way to show off how smart the blogger is.
With that in mind, let me humbly present my latest SQL Quiz, which is something I ran into at work recently, and will not...
What will the last two lines print. Will they be the same?
DECLARE @test VARCHAR(2)
DECLARE @first VARCHAR(4)
DECLARE @second< VARCHAR(4)
SELECT @first = ISNULL(@test, 'test')
SELECT @second = COALESCE(@test, 'test')
PRINT @first
PRINT @second
What do you think?
Technorati Tags:
SQL, Quiz
Yesterday I posted a little quiz with an example of an HttpHandler implemented as an ASHX file.
Brad Wilson obviously knew the answer, but only gave a hint for others to elaborate on. BigJimSlade (no link given) expanded on the answer. BigJim, I have a GMail account for you if you want one.
Calling HttpResponse.Redirect(string url) actually calls an overload HttpResponse.Redirect(string url, bool endResponse) with endResponse set to true. If endResponse is set to true, HttpResponse.Redirect will make a call to HttpResponse.End().
That method in turn calls Thread.CurrentThread.Abort(). Oh the depravity! Once again, Thread.Abort rears its ugly head.
So as you see,...
This is a simplified version of a sneaky bug I ran into today (I’m fine thank you, but the bug is dead). The only prize I can offer is a GMail account if you want one.
Imagine that the method HandleRedirect actually does something interesting and if all the conditions pass, the user is redirected to special.aspx. This is the source code for an HttpHandler implemented as a .ashx file.
<%@ WebHandler Language="C#" Class="MyHandler" %>
using System;
using System.Web;
public class MyHandler : IHttpHandler
{
/// <summary>
/// Processs an incoming request.
/// </summary>
...