Attention: We are retiring the ASP.NET Community Blogs. Learn more >

Archives

Archives / 2006 / January
  • Regarding Community Server and the ASP.NET developer community

    I made a pretty strong comment in response to Paul Wilson's post about a problem in CS. Alex Lowe sent me e-mail regarding that comment, and this is partly what I shared with him.

    First off... don't think that I'm dissing the product outright. That isn't the case at all. My point, if I didn't make it well, is that the product as a whole is too big and too complex for a small shop or individual to really work it in to the specific needs they might have. But again, that in itself isn't a bad thing, because a lot of companies need exactly what CS provides, a robust community that just works out of the box. That's what I mean by CS being a "corporate" product. Capitalism is good.

    I think the ASP.NET space in general suffers from overlooking the small user space, both small in terms of number and in experience. That shouldn't be that surprising because it does so much more than any of the "popular" platforms like PHP or whatever, but it does make hiring people hard and getting buy-in from the less experienced people. I'm crossing my fingers that the express products will help to change that, but MS is doing a crappy job getting the word out about them.

    Forums and now blogs have become a fairly standard part of every community site on the planet. I'm not shy to say that I spend more time in these apps than anything else other than news sites (which aren't that different from blogs either). Most developers, and by most I mean the legions that run the bulk of the Internet, not the few that code for the biggest sites, can't build their own stuff because of time, money and desire. If you're a PHP monkey you're totally set because phpBB is free, and vBulletin is still worth every penny. You've got options.

    In the ASP.NET space, we don't have a lot of options. Keep in mind that CS isn't free for commercial use, and unless I missed something, putting ads in and around your forum is certainly commercial use. So you're left with a number of relatively inexpensive options, many of which aren't very mature, and a few freebies that lack the features a lot of people want (and I'll throw my own POP Forums in that last group, after nearly two years between releases).

    Assuming that you do like one of those options, customizing it probably isn't that easy. I blame that a little on the platform, because there's a lot of matrices to follow around to understand how something works in the OO world, a much different place than the script world. I also blame the design of the apps to a lesser degree. I know I design for my needs first, and I suspect a lot of other individuals and companies that give something away do the same.

    What's the solution for that? Not sure. I had a discussion about complexity just today at my current gig. Stuff gets complicated and you have no idea how it got that way. I think it's sweet that companies like 37signals are challenging this problem, and largely succeeding. We need more of that.

  • What's wrong with HttpContext in an HttpHandler?

    I experimented some more with the problem I posted recently regarding setting Session values from an HttpHandler. Instead of using Session, I tried using the Cache object instead. The same thing happened... worked fine in Visual Studio, but not in IIS on the server. Here's the class... the value of Session["spamimage"] doesn't update after the first try (called from an <img src="AntiSpamimage.ashx"> tag), even though the image clearly is regenerated. Again, this works fine in the context of the built-in VS server.

    using System;
    using System.Drawing;
    using System.Drawing.Imaging;
    using System.Text;
    using System.Web;
    using System.Web.SessionState;

    public class AntiSpamImage : IHttpHandler, IRequiresSessionState
    {
        public void ProcessRequest(HttpContext context)
        {
            context.Response.ContentType = "image/gif";
            Bitmap b = new Bitmap(200, 60);
            Graphics g = Graphics.FromImage(b);
            g.FillRectangle(new SolidBrush(Color.White), 0, 0, 200, 60);
            Font font = new Font(FontFamily.GenericSerif, 48, FontStyle.Bold,
            GraphicsUnit.Pixel);
            Random r = new Random();
            string letters = "ABCDEFGHIJKLMNPQRSTUVWXYZ";
            string letter;
            StringBuilder s = new StringBuilder();
            for (int x = 0; x < 5; x++)
            {
                letter = letters.Substring(r.Next(0, letters.Length - 1), 1);
                s.Append(letter);
                g.DrawString(letter, font, new SolidBrush(Color.Black), x * 38, r.Next(0, 15));
            }
            context.Session["antispamimage"] = s.ToString();
            Pen linePen = new Pen(new SolidBrush(Color.Black), 2);
            for (int x = 0; x < 6; x++)
                g.DrawLine(linePen, new Point(r.Next(0, 199), r.Next(0, 59)), new Point(r.Next(0, 199), r.Next(0, 59)));
            b.Save(context.Response.OutputStream, ImageFormat.Gif);
        }
     
        public bool IsReusable
        {
            get { return true; }
        }

    }


  • Job hunting adventure

    I mentioned previously that I was looking to get back into the job market after a break lasting a few months. I had no idea that it was going to go so well, but particularly with the start of the new year, there's a lot out there. I have one formal offer, one informal and possibly another tomorrow. It's so crazy.

    There are a couple of reasons the jobs are coming to me. The first is that there is a serious shortage of qualified .NET developers in the Cleveland and Akron market. I don't know why that is, but part of the going theory is that Progressive (the auto insurer) is hoarding most of them. Seeing as how I used to be one of them, and with nothing to even do at the time, I think that's certainly possible. They pay a ton too, and kind of set what the market will accept in terms of compensation.

    The other thing is that when I got laid-off in 2001, I made the decision to seriously buy into Microsoft's vision of using the .NET Framework as the next big thing. It was only beta at that point, but it seemed interesting and I had lots of time on my hands. As it turns out, that was a good decision. By getting into it so early, I acquired something you can't fake... time. No one can say they have more experience in terms of time because it didn't exist any earlier than the time I got involved. It also gave me more time to make the leap to the OO platform, which for former script monkeys isn't easy, me included.

    The architect I talked to today was like, "Isn't it great to be in demand?" Yes, it is nice, but I honestly find myself feeling a little guilty about the whole thing. While a lot of my situation can be attributed to my own actions, some of it is luck too. A lot of people can't afford to take months off of work, and struggle to find a job. I'm very, very thankful that I've had this opportunity, and I don't take it for granted at all.

    I hope I make the right decision.

  • When Session objects don't update

    This is weird. I did that little HttpHandler that generates images in the simple NewsBlog app. It saves a sequence of characters to Session so the (hopefully not blind) user has to type in the stuff on the graphic and confirm they're a human.

    On my dev machine, works like a champ running it from VS. I deploy it to the server, and it saves the first set of letters to Session, but subsequent calls do not. Here's the code from the handler...

        public void ProcessRequest(HttpContext context)
        {
        ...
            context.Session.Remove("antispamimage");
            context.Session.Add("antispamimage", s.ToString());
            context.Response.End();
        }


    Why do you suppose it doesn't work right on the server?

  • Vista CTP was server?

    A friend gave me his key for the Vista CTP for December, and it worked. Here's the weird thing... when I came back and it was installed, it was Longhorn Server. Weird.