Archives / 2006
  • Paging in SQL 2005 like a ninja

    I'll be honest, I really haven't looked much at SQL Server 2005 because I really didn't have any incentive to. Sure, I've been using the Express version in production and it's super sweet, but honestly I haven't bothered looking any deeper into it. I did get the programming book Microsoft put out, and even read the new stuff, but didn't think much about it.

  • DropDownList with optgroup

    Many moons ago, I asked if anyone else thought it was strange that there was no way to add optgroups to the DropDownList. I've seen a number of solutions, including those involving control adapters, but I wanted to make something a little more simple, if hackish, for the old toolbox. Believe it or not, this tag has been around since HTML 4, and you've probably seen it before as non-selectable headings in a drop down or list box.

  • No love installing Visual Studio SP1

    I decided I'd give the SP1 install a shot Friday night, before leaving for Christmas activities. Boy was that a waste of time. First try, there wasn't enough space on the drive, which happens to be a Parallels virtual drive on my Mac. So I fattened it up with about five gigs to spare, and no love. Got the ever popular and incredibly useful error 2908. You know, the 2908! Duh! It was completely hosed after that, and I couldn't even start VS.

  • Still no Xbox Live support in XNA

    I see while I was on vacation that the XNA Studio Express was released, but still doesn't include any Xbox Live support. Considering that they seem to be fostering a "farm system" of development shops, where product would be distributed by way of Live anyway, I can't for the life of me figure out why they aren't figuring out this support. Who is really that interested in developing games you can't play with other people?

  • Daunting UI

    I was refactoring some of my moderation logging stuff on the forthcoming v8, and was curious to see how some other forums do it. I had not looked at vBulletin in a very long time, and was excited to see that they have a demo system that launches a completely new instance of the app with a fresh database for you. Sweet. While I can't really get into PHP, I'll be the first to admit that it's one of the best forum apps out there, even if it does flirt with being too feature rich.

  • Pissed about Vista and MSDN subscription

    Me and a friends were talking about how annoyed we are that Vista just hit MSDN, less than a month after our subscriptions expired. I'm sure there are a lot of people like us, who are independent developers that bought in right around the Visual Studio 2005 launch, with the implied promise of Vista in the distance. We were hosed.

  • The missing FindControl() method

    Most ASP.NET developers have probably used the FindControl() method before. It lives as a member of the Control class, way up in the inheritance hierarchy. Most also know that it's limited to finding only immediate child controls, unless you specify the UniqueID.  That always seemed weird when you used the method from the Page object, because you'd think it would go deeper.

  • VS2005 Web designer bug

    I was refactoring my little heart out on a project when I realized I had a Hyperlink control in several places that always pointed to the same place. So I made a derived class in App_Code, added it to pages/controls in web.config (<add assembly="App_Code" namespace="Awesome.UI" tagPrefix="Awesome"/>), and replaced away. 

  • I think the Membership dream is really just a fantasy

    Way back in early 2004, when I first got my hands on ASP.NET v2 and the Membership API, I though, wow, this is a seriously cool. What a dream come true to be able to plug this into any site and write your own provider. After all, isn't a single familiar and predictable interface to user data a good idea?

  • I f'ing shipped something!

    I've been in a coding slump for quite awhile. It seemed like I couldn't finish anything. Then, in a burst of inspiration, I made a bunch of changes to my blog app, and I launched NerdLifestyle. I had been sitting on that domain for almost a year with the intention of writing about nerd stuff, and never did anything with it.

  • What makes a developer happy with their life?

    Over the past few years, I've written about career and happiness a great many times. (And honestly, if you're one of those people who thinks I care about your dislike for posts like this, just stop reading and move on.) It's interesting how many time things have changed since I started this blog more than two years ago, and how I'm still not entirely able to answer the question: What makes a developer happy in life?

  • Apple really gets it

    The Apple announcements today were more or less what people expected, but there were some really nice twists.

    New iPods, yeah, that was an obvious move. Selling movies was expected, but I don't think anyone really knew they'd move up to 640x480 resolution for those and the TV shows, which is essentially standard definition resolution. They just hooked me, because that's about as good as a DVD, only without the piece of plastic. It's the quantum shift that music made a few years ago.

    Even more impressive is the "iTV" box that they previewed, and will ship early next year. People have been wondering for awhile if they'd introduce a DVR kind of device, and they've totally looked beyond that. A DVR is a broadcast-centric device, that has to do with the old distribution of content, on a schedule, via broadcast and cable. That's old news, and the a la carte pricing of content seems to be working. Let's face it, the best TV shows are like commercials for me to buy the DVD's. And if that new box really does support HD the way the demo did, the whole BlueRay vs. HD-DVD argument is even more pointless than it already is.

    There certainly is some danger for Apple. I mean, they have to accept some outside influence now and then. They were smart to work podcasts into the store. They support video of the same as well. As long as they don't close that out, the entire platform is looking positive.

  • A POP Forums milestone

    This evening I successfully made a post and reply with a newly registered account in POP Forums v8. It even logged the security actions.

    Half way there!

  • The wonders of data binding in ASP.NET v2

    One of the things that really got me excited about .NET v2 in early 2004 was the more declarative approach to coding ASP.NET pages. I like the idea of having a solid class library and then using as little code as possible in the actual page to get things done. The basic SqlDataSource in combination with various UI controls are great examples, but these barely scratch the surface of the cool things you can do.

  • Total switch to Parallels

    I deleted my Boot Camp partition on my MacBook Pro today. Once I started using Parallels for virtualization, there was no point. Now when I need to use Windows I don't have to reboot, I can share files, and I don't have to occupy some part of the hard disk with a partition that's partially unused. Sure, Parallels wasn't free, but it's a much nicer arrangement. Performance is top notch, and indistinguishable from the partitioned instance.

  • ASP.NET Profile sure has some weird quirks

    When you read a property from your Profile provider, you'd think that it will only call the provider's GetPropertyValues method, right? Well as it turns out, it's calling the SetPropertyValues as well, on every call. I can't for the life of me figure out why it would do that.

  • Config versus Database

    I was thinking a little about the pros and cons of storing configuration data in config files versus using a database. I have to tell you, that for all of the learning and work I did for POP Forums (like two years ago!) seemed pretty slick at the time, but now I'm not so sure that using config files is the way to go for most things.

  • Comment away!

    It turns out that anon commenting was turned off on the blog when they upgraded. Boo. I wondered why no one ever commented anymore.

  • Missing TechTV

    Leo says he'd love to do a TechTV reunion. God do I miss that channel. I sat down to watch The Screen Savers pretty much every weekday for almost three years. I couldn't get enough of it! The personalities on that show were top notch geeks. Over the years we always had Leo and Patrick, then later Kevin, plus Megan, Jessica and Sarah. Yoshi, Roger and Robert contributed good stuff, and even Martin was entertaining to some degree.

  • A four-hour software challenge

    I was thinking about stuff that I need to code for my sites, and was thinking about how I'd like a place for the public to track bugs. Yeah, stuff like that already exists, but it'd be nice to have something more basic.

    Then I realized it might be fun to crank something out like that for myself. As fast as humanly possible. Like four hours or less. Could I do it?

    I started to ask myself what it is that takes the longest for me. It's almost always the data access code, and more specifically, the test code to make sure it all works. I know that I test wrong by normal standards, in that my data access code is always dependent on the business objects that call it as containers. So a method that gets data from a table of users is called by a User object, and expects a User object from the data call. Most "experts" would say that's bad design.

    So if I can let go of the intense testing, maybe I'll give it a try.

  • Evolutionary media

    When I worked at Penton Media in 2000, the promise the Internet held was obvious to me. Here I was at a business-to-business media company that made its money connecting people who need to buy and sell each others shit. Some of those markets were very vertical, you know, niches. It was expensive as hell to put out those dead trees and do trade shows, but look at how cheap it was to stuff on the Internet!

  • I just can't test it all

    So here's the thing about test-driven development. I think it's awesome because it forces me to be more focused in my design and I know when I break something if I have to revisit it. But I suck at it.

    I test too much or too little. Sometimes I write tests after the code because I want to get something working quickly. I don't break things into small tasks like I should, and I let big picture temporary roadblocks slow me down.

    The bigger realization that I've come to is that TDD is amazing and awesome for back-end development. When I was first exposed to TDD, it was in an environment that was 100% executing code with no UI, like mainframe replacement stuff. Indeed, this development methodology is a big deal because you really don't have any other way to understand and be sure that the code you're writing actually works.

    When you're building a Web app, especially on the considerably smaller scale involving a team of one, TDD can get in the way. A lot of the time, I want to hack out some UI and start to drive my requirements from that. And if you think about it, that really makes more sense, because the UI helps define the solution to the business problem you're trying to solve. I'm sure that some consultants would freak out hearing me say that, but it's so true. The UI is something tangible up front, not a bunch of abstract bullshit that won't actually translate to something useful.

    That said, there are a lot of cases where TDD makes sense even in this scenario, because it provides a great apparatus to make sure what you're doing works. It's great for testing (and maintaining) data access code in particular. It also works great for making sure some kind of calculation or text manipulation performs as expected.

    So as is the case with most things in life, I'm finding the all or nothing approach using a particular methodology is just not practical.

  • Iterate, dammit!

    In my relatively short career in software development (which is still like 50 years in Internet time), I've been exposed to a wide range of development methodologies, project management and general dev culture. The easy trap to fall into is trying to apply what you learn to every new situation.

  • Tim O'Reilly is blowing it

    There was a big uproar over CMP and O'Reilly sending some guy a C&D letter for using the term "Web 2.0 Conference" in that those companies are using it as a trademark.

  • Yikes that's a lot of code

    As it turns out, I've already missed one of the milestones I set in my last post about my forum app rewrite. Instead of beating myself up over it, I'm just going to pat myself on the back for working on it at all, since this is something I've been wanting to do for, uh, more than two years.

    So far, there are about 4,700 lines of code, and 42% of that is test code. I know that I don't write particularly good unit tests, because I just can't always burden myself to think about them the way I should. I test too much or too little. Since so much of testing exercises data CRUD, I can say that it does serve me well in that it's easy to add or remove something and no immediately if I break it. Especially in an application like this, so much of it is data access.

    So what do I have so far? Membership, Roles and Profile are good to go with custom providers. They're not fully implemented, because there are certain things that, frankly, I don't need and I'm not going to waste time on them just to say that I fully implemented a provider. I'm not even supporting anonymous profiles. I also have fairly extensive security logging in place, which is something I've wanted for a long time. I think it's up to like 14 events that are captured now.

    Next up, probably before I bang out the meaty parts of forums, topics and posts, I want to figure out a clever way to encapsulate permissions. I've never done that very well. You know, based on your roles, what you can read, post to, edit, etc.

    The 37signals guys would probably freak out that I haven't done any UI yet. :) Granted, I already have a pretty good idea of what my UI should look like. But for all of their crazy "getting real" talk, I can identify with a lot of what they say. Some of it just isn't practical in real, large-scale software development teams, but there's truth to a lot of those beliefs as well. For example, I agree that meetings are toxic, as they say. On the other hand, I think worrying about scalability later is a bad idea, because if you get it really wrong up front, you're looking at a total rewrite later, and who has time for that?

    I hope I can continue to have this level of energy and wrap this project by the end of the summer.

  • Unexpected event regarding my book

    As I've said before, sales of my book have generally sucked. Again, great reviews and lots of e-mail from people who really liked it, but A-W did an incredibly shitty job marketing it (putting ASP.NET 2.0 on the cover would've been a good start).

  • The challenge of time management in a no-profit scenario

    While I haven't been making the kind of progress I'd like on my forum app, it has been on my mind a lot. Back in January I decided it was time for a regular salary job after two years of consulting, not for any financial reason, but to be in a place where my brain would be challenged and I wasn't the smartest person in the room. That part is going fairly well, but naturally with all of that time accounted for, I haven't spent a lot of time on my stuff.

    And as time has rolled on, the code in the old version gets more and more scary to me. It's three years old, and it's pretty bad. I wouldn't say I didn't know what I was doing back then, but I certainly know a little better now (until three years from now). To rebuild my existing communities around it, I need to rewrite it, and that's going well, just really slow. I set up various milestones that I want to hit, with deadlines, and already I've missed one.

    The problem is that I can't motivate myself to see these things as high priority when the pay-off isn't clear. I mean, having more scaleable sites with more manageable code is an obvious incentive, but things have been (barely) doing just fine for those three years. And on top of that, I give the code away. Ah, the good old days of ASP where I sold it for $175 per license! People wonder why I don't get the whole open-source scene. I like to get paid for what I do!

    In any case, right now I miss the days of sitting on my deck and editing my book in the middle of July. Those were good times, and I'm constantly reminded of them on nice days like today. But I need to get back to working for The Man... for now...

  • Adventures in HVX200 workflow with my MacBook Pro and Final Cut Studio

    The week before last I spent some quality time in the field with my HVX200 doing simple ENG work, and a little bit of editing. I didn't have any time to really play with settings or experiment. It was a media event to preview a new amusement ride. These are my impressions.

    First of all, P2 rules. When you're trying to get stuff online quickly, I can't imagine a better way to record than using P2. Tape is dead. I bought the camera in part because I needed something quality to shoot HD for the Web (yeah, you could call me an early adopter), and it didn't make sense to me to buy a DVX100 at this point.

    The camera itself performed as expected, and like a pro camera. Save for the non-shoulder-mounted nature of the camera, it did everything I expected. I have an Azden AZ-200UPR receiver and a Vidled that I had mounted, and both worked great with the camera, provided it was on the tripod. It gets a little heavy with that stuff if you have to go without.

    We shot interviews in 480/30p anamorphic, so we had plenty of space with a pair of 4 gig cards. There is little reason to go to a higher resolution for talking heads. I was doing the interviewing, so the guy I had shooting for me made some mistakes hear and there, especially with focus, but nothing was totally unusable. The overcast skies made for some goofy white balance at times too, but again, it wasn't horrible. Using Compressor to squash the video to H.264 worked as expected, and without issue. The images were a little on the soft side.

    I shot some stuff in 720p as well of the amusement ride. First I tried 24pn, figuring I'd go for that "film" look, and I knew immediately that was a bad idea. All of the tips and suggestions you read on this forum about capturing fast horizontal motion became evident, and having no experience in that area, it looked pretty bad. I tried again doing 60p, and it looked fabulous, even using the camera handheld. This compressed really well to H.264, but needless to say, it won't playback at speed on most computers.

    In every case, I was unhappy with the black levels in the compressed video, especially when viewed on a Windows machine. That's something I need to figure out. Playing back on an actual HD monitor via Final Cut Pro's full-screen function, it's still not great.

    I'm not at all happy with a lot of the images I shot, but I don't blame the camera, I blame myself for not spending the time with it I should have. It reminds me of the crap I used to shoot when I first got an SLR camera. With time, I'm sure I'll figure this out too. As is the case with most things I do, I can't really learn unless I can apply what I'm learning. I have to fail at something worthwhile, I can't just come up with some artificial situation and work from there. :)

    Getting this stuff to DVD was a lot more work than I expected too. Exporting cuts out of FCP sequences did not preserve the aspect ratio. Using default settings in Compressor, we didn't get good quality MPEG-2 for the DVD we wanted to send to the park either. Ultimately, I ended up telling Compressor that it was 4:3 instead of 16:9, so it wouldn't cut the resolution down to 720x404. Even then, it was coming out as 640x480, which someone in the Apple forum assured me was still 720x480 internally to QuickTime. Even more weird was the way it treated the 720p stuff when I wanted to compress it for DVD. I ended up having resize it first to an uncompressed Animation movie at 720x480, then compress that to MPEG-2. Going without the intermediate step introduced all kinds of interlacing artifacts that I couldn't account for.

    So overall it was a chance to do some experimentation, and as is the case with most first attempts, the results weren't great. You can see the product of some of this experimentation here:

    And yes, I know the images aren't great. :)

  • MacBook Pro Windows keyboard mapper

    I found this little utility for remapping the keyboard on the MacBook when you're in Windows:

    It works pretty well, and maps the little enter key to a right-click, and the fn key makes the arrow key functions work. The UI is pretty bad, but if I can figure out how to map the F12 key to a Windows delete, I'll be happy.

  • The good and bad of Microsoft

    I was thinking today about Microsoft, and what it means to me specifically. Oddly enough, I have no stake in the company, but it has a stake in me since I buy its products and its products have largely been the reason for my financial success.

    First off, Microsoft has done a lot of things right. The Xbox 360 is the crown jewel of the empire right now, and it demonstrates that careful thinking and passion can create something truly great. I don't think you'll find a single person who owns one that will say it sucks. It's easily the most impressive piece of consumer electronics I've ever owned.

    Then there's Visual Studio and ASP.NET. It took a few years to get there, but the 2005/2006 products are everything I've ever wanted in a development platform (well, as long as you don't count the embarrassing state of the Web unit testing that I bitch about frequently).

    But on the dark side of things, they've been stumbling around. Windows Vista has become a nightmare with the constant slipping ship dates. As a recent convert and believer in OS X, Vista is a much needed step in the right direction, but it feels as if it will never ship. Seeing as how the OS (and Office) are what really pay the bills, it's not comforting to see this downward spiral.

    Then there's the mess in marketing. It started with the over-use of ".NET" on every product name, and it just keeps getting worse. Who the hell knows what they're even about anymore. It's so hard to understand as a consumer why Microsoft exists, and why it's good for me. It's not easy as a business customer either.

    It's funny though how there's such a stark contrast between the good and bad. The company is just so damn big. I hope they can get those smart people in the right places to save the parts that have been such a disaster.

  • Providers, POP Forums and testing hell

    First of all, I have to mention that Scott posted info about the release of source code for Membership, Profile and other provider stuff. I haven't yet looked, but how cool is that?

    Speaking of which, I had a volleyball coaching trip to Baltimore last weekend. Instead of going out and tearing it up, I locked myself in my room when I wasn't coaching and worked on POP Forums code. I finally have configuration and membership 100% coded and tested, both with the business classes and the data access classes. That doesn't sound like much, but considering that's the newer ASP.NET v2 stuff that didn't exist before, I feel like the rest will be a lot easier to deal with.

    Of course, that wouldn't have taken so long if it weren't for the incredible nonsense that shipped in Visual Studio Team System for Developers. Yeah, I'm talking about, "You can do ASP.NET unit testing... sort of. OK, actually you need to hack around getting it to run through IIS, and then manually attach the debugger to it. Letting you click 'run tests with debugger' and starting the dev server and attaching it was too logical and convenient."

    I can't even tell you how annoyed I am by that whole situation, and I just don't understand how anyone could have allowed it to ship like that. ASP.NET unit testing works like a champ, until you have to debug it. It's a total joke.

  • What BootCamp really means

    John Gruber wrote what I think is the most common sense analysis on what the release of BootCamp for the Mac really means. I agree with everything he said. Apple certainly doesn't compete with Microsoft, they compete with hardware OEM's. The simple financial snapshot of Apple makes this very clear.

    I don't know if I'm typical, but I bought a MacBook Pro the day they announced BootCamp. I needed a good laptop, I love OS X, I wanted to edit video with Final Cut Pro, and of course, I need to make a living using Visual Studio. The machine does all of these things, and it does the Windows stuff faster than any other machine I've ever owned. To say I love that little box would be an understatement.

    Sadly, the more time I spend in OS X, the more I realize how much Windows really blows. It's not just that it's somewhat visually offensive, it's just that years of compatibility requirements make Windows more complex instead of more simple. The registry is a mess that "rots." Support code libraries get everywhere, and you never know what's safe to get rid of (DLL hell). Admittedly, if we could move to a 100% .NET world, along side of WPF, we could all sleep easier, but that's just never going to happen.

    For example, I had to uninstall something on my Mac. I dragged it out of the Applications folder into the trash. I found its support files (preferences and such) in the Library folder, and ditched that too. Gone. No trace of the app anywhere. Even the most simple app on Windows can't uninstall that quickly or cleanly. It's ridiculous.

    I'm not suggesting that the Mac is perfect. I can't get my Bit Torrent client to work, for example, but in the big picture that's not that big of a deal. But overall, I'm enjoying using the computer as both a tool and a lifestyle device, something that isn't as easy in Windows. But I can still write my ASP.NET applications on my Mac, and I've never had a machine that ran Visual Studio, SQL Server and Photoshop so well. I love it.

    I can't be a 100% switcher, but for life outside of writing code, I'm there.

  • More MacBook fun

    Last night I realized that my Windows partition on the MacBook really didn't need to be more than 20 gigs, so I started over since I didn't do much to install various applications. I had a weird thing where pci.sys disappeared, no idea how, so I had to do a repair install, which wasted about 45 minutes.

    Avid Xpress Pro HD, not surprisingly, wouldn't edit HD. I could see stills, but it wouldn't let me scrub through the video. Not that it matters I guess, since Final Cut is in the mail, but it's almost like I'm glad because I can move on. On the plus side in Windows, Visual Studio 2005 and Photoshop absolutely scream. In fact, reading some of the benchmarks that are starting to appear, the MacBook out performs most Windows laptops period, even with similar configurations. Well done, Apple.

    What I'm really having the most fun with though is the Mac side of things. For all of the crap Microsoft gets for bundling stuff, the critics fail to mention that the bundled stuff is generally crap.

    I started to play with iPhoto, and imported about 750 photos. It has camera raw support right out of the box, and does some light editing. And as Jobs said, it really is "like butter" in terms of quickly scanning through the library. I love the way it organizes to, a la iTunes with albums instead of physical folders. I may actually make this my dedicated repository for photos.

    I played with iMovie and iDVD as well. Windows Movie Maker is a joke by comparison, and there is no Windows DVD maker. PhotoBooth is mostly useless, but it sure is neat. There are so many cool things right out of the box that an average person can do with a Mac that you just can't do in Windows.

    Alex suggested a great IM client that I played with a bit last night. I'm really digging that even more than Trillian on Windows. Burning stuff is faster and more straight forward. Front Row is a very neat app, and I suspect I'll use it in the hotel (with remote) on my travel the next few weeks.

    More than anything, it's just so much more responsive than any computer I've ever used. I mean, the thing boots in a dozen seconds after POST (to OS X, Windows takes longer).

    I'm still happy to report that no Dell or HP with similar specs costs less, so all of the haters, take note. This is much better hardware, it costs less (for now) and you can run OS X. Did I mention the power connector is the coolest thing ever?

  • First touch in MacBook Pro

    With the release of BootCamp yesterday, Apple removed the last objection I had to owning a Mac, so I bought a MacBook Pro at the local Apple store. Ouch. Can you say purchase regret? This should be the last thing I need to buy for my video/film empire, along with Final Cut Studio, which is shipping by FedEx.

  • Post conference indifference

    Now that Mix06 is becoming a distant memory, I have to admit that a lot of the excitement I felt there has gone away. The reason isn't what you'd expect though... it's that I got sick the very next weekend. For four days I had a ridiculous fever, coughing etc., a combination of a respiratory and sinus infections. It sucked. I blamed the Venetian Casino Funk (seriously, do you have to allow smoking in non-casino areas?) and Continental Airlines Sealed Aluminum Can Funk. I'm sure that's where I got it.

    But I do want to write code. And I want to shoot video. I want to get my shit together. But it's so hard when your body is struggling to just catch up.

    I need a week off in the worst way.

  • Mix06: Final thoughts

    Sadly I couldn't stay for all of today's sessions in order to get home at a reasonable time, but I did finally get to meet Rob Howard from Telligent (former Microsoft) after conversing with him for years by e-mail, forums and blogs. Good to finally match a face with a name.

    There were really two big stories in terms of product. The first is Atlas, the AJAX framework that makes it very easy to build stuff in ASP.NET. There's a lot there to use with other platforms as well, but it's so easy that I don't know why the hell you'd want to. It's fairly amazing.

    The other big story is Windows Presentation Foundation. I personally wasn't that excited about it, and didn't go to any of the sessions, but I peeked in on one of them (The North Face demo) and was impressed. Obviously a lot of people are interested because the session was packed. I kept hearing in the halls that they're planning on releasing it for other platforms, including the Mac OS and Linux. If that happens, it's suddenly a lot more useful.

    There were a lot of bigger picture panels and such that I got a lot out of too, including the revenue model thing and the future of Web advertising. The most interesting opinion on the former was about the validity of subscription models, and they all agreed it was still possible to make money that way. Tim O'Reilly has reason to believe that, in that his Safari online service is 25% of the company revenue now.

    There's a lot to soak in. Hopefully the heavy drinking at TAO Monday night didn't erase some of the day one stuff. :)

    As I mentioned before, I wrote a little more on my personal blog...

  • Mix06: Gates keynote reaction

    Interesting keynote. Kinda cool to be ten feet away from The Bill, despite the scary secret service types near by.

    Anyway, the speech started with the typical marketing stuff, which isn't that interesting, and honestly I think Gates himself wasn't that interested in it. He's a geek first I'm sure, but he has a giant company to plug.

    He brought on the MySpace guys... my God... they're just kids. I clearly missed an opportunity while I was wasting away working for shitty companies. Not a big deal I guess, as I'm not looking to get rich with what I do on the Internet, but it's amazing how relatively simple ideas blossom into amazing things. They showed a crude preview of their next profile management tool, and it was kind of interesting. "Shut up moron" to the guy who yelled out to the MySpace guys to open up their API. Fat stupid idealist Net hippy.

    The guy from the BBC showed some neat stuff based in Windows Vista. Very impressive, and pretty. There's still that part of me that says, "So what, it's tied to Windows," but still very interesting.

    The best part was bringing on Tim O'Reilly, who really did do a no-holds-barred Q&A with Bill. In fact, he forced Bill to say what I've been saying for years. Microsoft didn't crush Netscape, they shot themselves in the foot by giving away their product in the first place. Some competitors are quite good at failing on their own.

    The Q&A stuff was where you could see how excited he gets about tech. I thought it was interesting that he talked about how competitors have vastly different business models. That's something I think about a lot (there's a session with O'Reilly this afternoon), because all of this feel good community, collaboration, "mashup" nonsense (I hate that word), etc., doesn't just equate to money, unless you sell your thing to Google or Microsoft.

    So in any case, a good start to the conference. I actually forgot that I'm in the world's most distracting city. :) Must... resist... outside world...

  • Observations from the hallway

    I'm sitting here on the floor outside of the ballroom where the Gates keynote is happening in about 45 minutes. Let me paint you a picture...

    There are scary guys in suits with earpieces and lapel pins that look like movie secret service people. They're everywhere. I'm not sure why that surprises me, because if I was the richest man in the world, I'd be a little nervous about appearing in public as well.

    There's a German guy here sitting next to me talking via Skype, presumably to Germany. This strikes me as interesting just because people in this community don't even think about using this kind of technology, even though it's not mainstream.

    I'm really surprised by the number of Japanese here. I don't know how the conference was marketed, but clearly they do OK over there. And how appropriate that there are five Japaense TV stations in the rooms.

    More after Gates...

  • VSTS Testing for ASP.NET still isn't where it should be

    After my last post on the subject, I'm sorry to say that I'm no better off than I was before. Unfortunately, debugging tests in ASP.NET simply doesn't work, and there's no good excuse for it.

    Now I ask you, how is it that the team developing the testing framework for VS was allowed to ship the tool without it doing what it's supposed to do? These kinds of head scratchers drive me crazy in the face of what I'd consider brilliance otherwise. I just don't get it.

    To recap, as indicated in this useless article, you can't debug because VS isn't smart enough to attach itself to the process it's creating to run the tests.


    Trying harder to attach to the dev server process, I discovered that it creates a new instance when you run the tests, which is not what is described in the above linked article. My test attributes look like this:

    [AspNetDevelopmentServerHost("%PathToWebRoot%\\PopForums.Test.Web", "/PopForums.Test.Web")]

  • What causes a response lag in IIS?

    In the last month or so, my Web server started to lag in its response. I've done the normal things like check CPU usage and disk activity, and neither one is a factor. Sometimes though the server doesn't respond quickly, and I'm not sure why. The problem exists across all of the sites on the server. I'm annoyed.

  • More Visual Studio pain

    I conceded to use VSTS testing instead of NUnit in order to enjoy the tests running under the ASP.NET runtime, but now I can't debug. This page describes how you should be doing it, but it doesn't work. First of all, it wasn't obvious (and why would it be?) that running tests with debug didn't actually work. If it's not going to work, then why the hell would you not tell the user this?

    In fact, the first time I did this, VS spawned two WebDev server instances, then a third where the tests were actually run. The other two remained active when the tests ended. The one that appeared then disappeared was for the Web project (file-based with testing code), while the second one pointed the same place, and the third pointed to the production Web project (also file-based). Needless to say, it's the one that appeared then disappeared that you have to attach to, as that's the one that is acting as the environment for the tests.

    Why is it that with every step forward, we take a step back?

  • Why must Microsoft tools work against me?

    Let me say that Visual Studio 2005 is a huge step forward in a lot of ways, especially for Web developers. What still sucks though is database handling quirks.

    For example, I just want to open a query window against a SQLEXPRESS database in my Web project and fire off some SQL. You know, the way we did in the old days. I want to create a table from SQL commands, and it tells me, "The CREATE TABLE SQL construct or statement is not supported." Then below that is says the query can't be represented graphically in the diagram and criteria plane. Well no shit, that's why I turned it off.

    So then I figured I'd fire up SQL Management Studio and just attach to the database. Yeah right. I try to attach to the file, and the file dialog doesn't let you type in a path, and won't navigate beyond the user name in the Docs/Settings folder (I happen to have the project on a desktop folder).

    I eventually went back to the VS IDE and did a mass check-out from source control, and suddenly the table create query runs. That's not surprising since the database is probably read-only while checked-in, but why didn't VS tell me that instead of telling me CREATE TABLE isn't supported?

    Nothing annoys me more than fighting the tools for ridiculous amounts of time to do simple things. And that's the way it always is with Microsoft tools. Usually 95% of what you do is powerful and easy, but then you lose all of that saved time with dumb shit like this.

  • Unit testing programmatic web.config edits

    Perhaps there's some easier way with VSTS's testing, but because I know not everyone has that, I'm trying to write unit tests for the programmatic manipulation of web.config data.

    So on one hand, you've got...

    System.Configuration.Configuration config = System.Web.Configuration.WebConfigurationManager.

    in your configuration editing junk. Works like a champ when you call Save() on that object. The problem is that HttpRuntime.AppDomainAppVirtualPath has no value in a unit test. The weird thing though is that you can call the above code from the test and call it's Save() and it throws no errors. It sure thinks it's saving some config data somewhere, but I can't figure out where.

    I know I'm being nutty here, but I really want to be able to test this stuff. Any suggestions?

    EDIT: Actually, the test is manipulating web.config in the C:\WINDOWS\Microsoft.NET\Framework\v2.0.50727\CONFIG folder. That's odd.

  • Due to caching and moderation, it may not be displayed right away.

    We have an internal CS blog here at my current gig. You get this when you comment:

    "However, due to caching and moderation, it may not be displayed right away."

    Am I the only one troubled by this as being generally bad form? In techie circles, sure, whatever, I can deal with that, but would John Q. Pornsurfer care about the technical implementation? And even if they did, why wouldn't the update cache-bust the data anyway?

    Maybe one of the Telligent folks can explain the thinking on this.

  • How do you unit test an HttpModule?

    I would think that blasting through Google I could find an answer to this, but I'm not finding anything useful at all. How does one unit test an HttpModule? I can't imagine that it's not possible. I'm not sure how to fire off and test the various events or simulate the request/response lifecycle.

  • File change behaviour in v2 not so good

    As you'll see in this post from Scott, app restarts now occur whenever you add or delete a folder. That's bad news. I know of at least one application that I've written that has to add or remove folders from time to time.

    We should be able to turn this off. It seems like an arbitrary and not well thought out change.

  • More confusion about custom Membership and Profile providers

    OK, so help me out here. I was looking at the default system-generated database, and it stores the membership user reference for the profile table as uniqueidentifier. How can it do that if the current Membership provider uses some other data type? As I mentioned in my last post, I don't understand how this can be. MembershipUser.ProviderUserKey is an object, so it can take anything. It's not limited to guid's.

  • How to store the ambiguous "object" used as key to Membership records

    The ASP.NET Membership API calls for System.Object to the be the type used as the ProviderUserKey. This way, your provider can use whatever you'd like as the key field for your user records. The built-in SQL Server provider, for example, uses a Guid.

    The provider I wrote uses an int instead. That part doesn't concern me... it's what I use in other calling code. For example, I might have an Orders table that is associated with Membership users. But how do I keep it provider agnostic? Sure, the object representation in .NET can simple be System.Object, but when it's time to store something in that Orders table, how do I get object to the database?

    Any suggestions?

  • The death of People and full adoption of Membership and Profile

    Way back in early 2004, when I began writing my book, I wrote Membership and Profile providers that acted as wrappers to the People class in POP Forums, which I used for a very long time to store user data. It seemed like a good plan at the time, because then anyone could jack into the forum's user management using the familiar interface. They couldn't do the opposite though, because all kinds of junk was dependent on People, and there were several relationships in the data there too.

    But alas... what I've always wanted was that two-way street for integration. The provider model makes this easy enough, but you more or less have to let this user data live in its own little world. That was always obvious to me, but I've let my own sites and projects dictate the best way to rewrite the forum, which is stupid. That's the very reason I've had to shoehorn things into that format.

    So taking a clean-sheet approach, I've spent the last few evenings refactoring the providers and ditching People entirely. It's liberating. There will be some SQL scripting to deal with when it comes time to deploy in my own sites, but when it comes to user data, it should be the last time I ever have to do it. The benefits are already clear with some peripheral projects I want to do, and even a theoretical single-login system across all of my sites. Good times!

    I've been so energized to write code again lately. Not sure why. It's odd that when I was slacking, er, being self-employed, I wasn't motivated to do much of anything. Now that I've gone back to a day gig and talk to people smarter than me, I'm spending my free time writing my own stuff again. My personality is seriously odd.

  • Going to Mix06!

    Quite unexpectedly, I got an invite to attend Mix06 in Las Vegas next month. Normally this conference costs a grand to attend. So I'm in, no matter what it costs to get there and stay at the Venetian (where Blue Man Group also lives, I might add).

  • Locking up my code in the Vault

    After screwing around with, what did I call it, The Steaming Pile of Crap that is Visual SourceSafe 2005 in Internet mode, I remembered that SourceGear's Vault was still free for the single user. So I installed that on my server, installed the client, works like a champ from within Visual Studio 2005.

    I don't quite understand why VSS has been so neglected over the years. Aside from the HTTP capability that only works under perfect circumstances, it really hasn't changed in at least five or six years. I hope it wasn't for the sake of using Team System, because God knows anyone outside of a major corporation can't afford the server product.

  • VSS 2005 Internet install a steaming pile of crap

    Wow, who signed off on this complete piece of crap? Seriously, if you Google for "sourcesafe 2005 internet" you'll see just how many hoops people had to jump through to get the damn thign working.

    I haven't actually tried it myself, but it shouldn't be any harder than pointing a new Web site in IIS to the directory where the ASP.NET app resides. Why the hell is it so hard to get it setup.

    I haven't even tried to connect to it via Visual Studio. Can't wait to see how that goes.

  • The torture of the application recycle

    I always read about this kind of thing, but can't imagine why anyone has the problem. Right now, it's happening to my current employer's test box.

    The ASP.NET process is recycling frequently and seemingly at random. We can't figure out why. However, we did fire up the new health monitoring code in our web.config, and the app restarted because, it said, the "configuration changed."

    Well, that certainly qualifies as one of the reasons an app will restart, but no one is molesting any configuration. Any theories?

  • Exploring the hobby to middle market

    I think about the middle people a lot. I'm one of them. I'm not an enterprise architect, but I'm not a PHP script monkey either. I don't get rich off of the sites that I maintain, but I make a good chunk of change that supports my expensive gadget habit. The bulk of people like me use the LAMP stack, if you're inclined to believe the analysts and consultants. That's a bummer.

    Let's face it, I use Microsoft's platform because it's what I was exposed to, much in the same way that we typically adopt the religion practiced by our parents. Now that I'm older and wiser (hahahaha, yeah right), I tend to feel that having made a choice to go from ASP.old to ASP.NET was a good one, and sticking with my own brand of Christianity seems to be working OK too.

    But here's the thing... I don't feel like I'm being served well by Microsoft and the community in terms of getting what I need. I get along any way, but that's because of my tenacity for knowing as much as I can, regardless of what practical use I put that knowledge to. Let me explain.

    First there's the product at the core of our world: The .NET Framework and the visual tools. Best stuff ever as far as I'm concerned. This is one area where Microsoft has done a good thing, giving away the express products. That took some real balls to get the stuff out into the open for free. It's a good first move, even if they haven't done a good job about getting the word out about it.

    Then there's the issue of education. I have a lot of mixed feelings on this, and I'm sure purists will tell you that .NET, an object-oriented development platform, just isn't intended for the hobbyist and middle markets. I think that's a load of crap, because while there is a huge shift in thinking that script monkeys have to make, it's not impossible to grasp. But getting there is insanely difficult because Microsoft documentation tends to all be high level, and it's hard to read if you're a n00b. Articles around the Net also tend to talk over the new or transitional person. I'm not sure how you address this, though I think there's room for three kinds of documentation to satisfy different levels of experience.

    Books help, but far too many beginner books treat ASP.NET like a variation on script, which is not helpful. I tried to address the totally ignored middle-people segment with my book, and while people seem to like it, it hasn't been well marketed by the publisher. Then the high-level books tend to just be re-hashes of Microsoft documentation.

    I guess where I'm going with this education thread is, how do we get people beyond asking the same old questions over and over again in forums? Who really owns that responsibility anyway? Honestly I don't know.

    Finally there's the issue of good applications we can use for free, as either a base for various projects or as a learning tool. I admit that burden falls on people like me and higher. There's a lot of mediocrity at one end, and brilliance at the other end that's too hard for the middle folk to understand given their experience. I've been on a real "simple is better" campaign as of late, but it's funny how different people see "simple" as different things.

    Am I making any sense here? I want people like me to embrace .NET the way I have, but it seems hard. It wasn't easy for me, and had I not been laid off like a hundred times, I doubt I would've gotten there (let alone write a book).

  • The little Internet business that could

    There are a lot of little businesses on the Internet. Some are electronic extensions of real-world things like garage sales (eBay "workers") while others are totally new ideas that have reached critical mass (Digg). The important thing to note here is that there was little to no cost involved in getting these businesses started.

  • Testing at the end? You can't be serious

    I noticed a link to this Waterfall Conference that also a keynote called "Put Testing Where It Belongs-- At The End." I'm in awe that anyone would say something that, to me at least, is so fundamentally stupid. And yeah, I know this is a joke, but people out there actually think this way.

    Let me start that I don't get into religious arguments, whether it be about New vs. Old Testament, Linux vs. Windows or Agile vs. Everything Else. Those discussions just aren't interesting to me. However, the bigger an application gets, and the more people involved, the more I feel that test-driven development is absolutely essential to building something that works. I honestly could care less about most of the tenants of XP or agile, but TDD has saved my life.

    And I do get why people are skeptical. The gig I just started has a lot of people skeptical about unit testing in general, mostly because it's considered an afterthought. It really is a cultural shift. People think it's more work, but no one can ever ask the fundamental question, "How do you know the change you made didn't break something you haven't thought about?"

    When I first started a gig at Big Ass Auto Insurance® as a consultant, they were buying into everything agile. The paired programming thing annoyed me, and I hated it, but the test-driven stuff fascinated me. Here you could fire off the tests from the entire solution, testing tens of thousands of lines of code, and if something you did broke something, you knew about it. In fact, if you didn't run the tests, the continuous build process would tell you that something was broken. Without this testing facility in place, you had to rely on poor metrics like a lack of compile errors, peer reviews that assume someone in the room knows the rest of the system, etc.

    This doesn't even get into the trouble that is test bias. You can't write unbiased test code if you've already written the code. You're too close to it. While unit testing assumes you're doing thorough tests and driving the design of your classes from those tests, it still gives you confidence your stuff works.

    Now regarding the waterfall methodology, most of the instances where I've been around it, it fails, or delivers low quality software. Again, I'm not religious about any one methodology, but anyone who has written one line of code knows that stuff comes up, and specifications frequently have to change. I don't know why people try to fight that. Keep the stakeholders involved at all times and the change management is tolerable. That's one of the things I like about a more iterative process, is that you can refactor to a place that you get what you want and need, not what you thought three months ago you wanted and needed.

  • Directions on forums and writing

    After I finished my first book, I started to think about what I'd write if I did another one. I wouldn't write anything if it wasn't something I was interested in, so it had to be relevant to my interests. I discussed a book with a couple of publishers that was based around the end-to-end creation of a significant ASP.NET application, namely POP Forums. At the time, v8 wasn't much more than a idea (and still is hardly where it needs to be), so it seemed like a good idea at the time.

  • 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,
            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);
                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.Add("antispamimage", s.ToString());

    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.