dnrTV – Generics

I keep meaning to watch dnrTV, but I never seem to get around to it. I need to find about an hour where I can sit still in front of the computer, and give it my full attention, and that isn’t easy lately. I did just watch show #9, with Venkat Subramaniam talking about generics in C#. This is one of a handful of topics that I’ve got on my mental to-do list to learn more about. I see that show 105, the most recent show, is also about generics, so maybe I’ll try and watch that one tomorrow.

There are a number of shows on CSLA.NET, which is another topic I really need to learn about. I really need to talk myself into watching this stuff more often, and maybe watching a little less Frisky Dingo!

reference vs. value types, and LINQ

One of the people I work with was having some trouble with reference vs. value types (in C#) this week. This article seems to give a pretty clear explanation of how these things work. Always good to have a little refresher on the fundamentals.

And, in poking around on this guy’s web site, I found LINQPad, a tool for executing LINQ queries. I have to admit that I haven’t had any time to play around with LINQ at all, but I’m really curious about it. I like his idea of trying to do all your ad-hoc SQL queries in LINQ for a week, to force yourself to start getting used to it. Some of the stuff I’m doing this week is requiring me to do a *lot* of ad-hoc SQL, though. My brain is so completely wired for T-SQL at this point that I think I’d get really frustrated really quickly trying to use anything else.

Dynamically Created Controls in ASP.NET

I was working on a project last week that involved dynamically creating a bunch of controls on an ASP.NET page, then trying to, um, do stuff with them. (For lack of a better explanation…)

This article does a good job of explaining something that I’d kind of missed at first: dynamically-created controls don’t stay on a page after postback, normally. The “Page” class is stateless, destroyed after rendering the page. I didn’t wind up using this guy’s solution; I actually realized that I didn’t need to be dynamically creating the controls at all. I’d copied my page from another page that *did* need to create controls dynamically, but after I looked at my own page, I realized I just didn’t need to do things that way.

I’ve been doing more ASP.NET programming than usual lately, because I’m trying to finish up a project for a big client at work, and it’s kind of tricky and time-sensitive. Because of that, I’m just doing it (mostly) myself instead of farming it out to one of the other programmers. I’m having some fun with it. Aside from the dynamically created controls, I’m also playing around with generics a bit. This article by Jesse Liberty was helpful for setting up a simple collection using generics.

AppleScript

Related to my little iTunes buying spree from yesterday, I’ve been trying to find a good way to keep my purchased iTunes stuff in sync between my PC and my Mac. I’ve been thinking about just using rsync or something, but I haven’t gotten around to playing with that yet.

Instead, I started looking into doing this with AppleScript. That seems like it should be easily doable, but I haven’t been able to get this set up exactly the way I’d like. I started with a “copy files” script found at Doug’s AppleScripts for iTunes page. The script just copies any selected songs in iTunes to a single location. I’ve just been selecting my most-recently purchased stuff in the “Purchased” list, then running this script to copy the files from my Mac to my PC. Then, on the PC, I just drag the files over iTunes, and they get moved into the right directories automatically.

I’ve got two little problems with this script: First, it tends to come back with an error when it’s copying a big video file. Second, it doesn’t provide any feedback while it’s copying (no progress bar or anything like that). I decided to see what I could do about that, and came across this article at MacTech. I managed to use the example from that article to put together a nice app with a progress bar that should do just what the original script did. It compiles OK, but, unfortunately, doesn’t work when I call it from the iTunes script menu. Clearly, I need to do some more reading on AppleScript and figure out how this stuff works. Also, the script uses the same method to do the file copies as the original script, so I’m assuming video file copies will probably error out the same as they did in the old script.

ACM

A few months back, I blogged about ACM’s deal with Safari and Books 24×7, where ACM members can access a subset of these online libraries. At the time, the book selection on both sites seemed to be a bit out of date. Well, they’ve updated the selection on both sites today, and there’s definitely more useful stuff up there now. They’ve (finally) got some ASP.NET 2.0 stuff, including the “ASP.NET 2.0 Core Reference” book by Dino Esposito, which is pretty useful. They even have some stuff on WCF and WPF.

The printing capabilities on Safari have gotten a bit more useful, too. I don’t remember exactly how it used to work, but it’s definitely easier to print a big chunk of text than it used to be.

I’m not sure that much has changed on the Books 24×7 site, though. I think there’s more .Net 2.0 stuff than there used to be, but I did a search on “Vista” and found nothing at all, initially. That’s not good. (I later found two Vista books that inexplicably did not show up when I searched for “vista”.) The Safari site has about four Vista books, which is OK, but not great.

asp.net performance

We’ve been having some trouble with our main ASP.NET application in work recently. (It’s our intranet, basically.) It’s been growing a lot lately, with more and more functionality being added to it, and more and more users accessing it. It’s running on a Windows 2000 server under ASP.NET 1.1. I have a new server set up that I’m planning on moving it to — it’s running Windows Server 2003, and I was planning on upgrading the app to ASP.NET 2.0 before moving it over. Given the performance problems, though, and my general lack of spare time, I’m thinking about moving it over as is, just to see if that helps, then maybe upgrading it to 2.0 later, when I have some time.

I know that there’s probably a lot I could do to tweak the performance on this application. We’ve done very little in the way of performance-tuning on our ASP.NET stuff. I discovered a book from Microsoft yesterday, Improving .NET Application Performance and Scalability, which I think should be some help in guiding us through some tuning and optimization. The book is available as a PDF download, and it’s about 1100 pages. I read through a couple of chapters tonight, and it’s definitely got some useful advice on ASP.NET, ADO.NET, and SQL Server tuning. There’s plenty more in there too, but that’s all I’ve had time to read so far. I’m finding it useful enough that I went over to Amazon and ordered a used copy of the dead tree version. Highly recommended, if you need to do some .Net tuning, and you’re not sure where to start.

lots of computers

Right now, I’m running a full backup of my desktop PC to my new 500 GB external drive. I’m also working on wiping my old Gateway and reinstalling Windows XP on it, so I can hand it off to a friend who has some use for it. And I’m also installing various things on my new Vista laptop. So I’m jumping around from machine to machine, checking on stuff, pressing “OK” a lot, and stuff like that.

On the Vista laptop, I’ve spent several hours trying to get Visual Studio 2005 and SQL Server Express set up. Everything seems to be working now, but it sure takes a long time to get that all set up. First, you have to install the original VS 2005 package from DVD. That takes a while. Then, you have to install SP 1. That can take quite a while: several hours. There’s a good explanation for this lengthy install here, and apparently Vista adds even more of a complication to this, so it takes even longer under Vista vs. XP.

After SP1, you need to install the Visual Studio 2005 Service Pack 1 Update for Windows Vista Beta. I’m a little alarmed that this is still a beta; you’d think that one of Microsoft’s first priorities would be getting a good solid development environment running on Vista.

And, if you want to bring SQL Express up to date, you need to install SQL 2005 Service Pack 2. I’m not 100% if I had to do both of these, but I installed “SQL Server 2005 Express Edition with Advanced Services” and “SQL Server 2005 Express Edition Toolkit”. Then, I went back and installed the latest Books Online files.

So, all that took about four hours. Call me crazy, but that really seems like too long just to set up your development environment. Back in the old days, it’d take maybe 5 minutes to install, say, Clipper 5.2 or Turbo Pascal. I guess this is progress, but it doesn’t feel like it!

ACM

I’ve been playing around today with the online book access I can get through ACM. You can get access to about 500 books from Safari and 400 from Books 24×7. Mind you, there are thousands of books on the main Safari site, and thousands more on the main Books 24×7 site. A regular Safari subscription is $20 per month, and Books 24×7 is about $450 per year, so both those options are a bit expensive. There are some useful titles among the limited library of books available through ACM, but not too many recent ones. For instance, there’s a good bit of stuff on .Net 1.1, but very little on .Net 2.0. I don’t think I could just stop buying computer books, based on the selection available through ACM, but there is some good reference stuff there. There’s also not much you can do in the way of printing from either service, within the ACM section. Still, I’m going to try to keep this stuff in mind before running out and buying any more computer books, and I’m going to try to remember to seach these services the next time I’m trying to solve a programming problem.