dnrTV: .Net 2.0 stuff

I just watched dnrTV 18, on new language features in .Net 2.0. I was already familiar with partial classes, but they also went over some more esoteric stuff, including covariance and contravariance, nullable classes, and anonymous methods. Geez. There’s a lot of odd stuff in .Net that I just don’t know much about. Well, I guess that’s the point of watching screencasts and reading books and whatnot, huh?

yet more dnrTV

Not that anyone but me is going to be interested in this, but I watched dnrTV show #13 today, the second part of the CSLA.NET 2.0 overview. I’ve only scratched the surface on CSLA.NET so far, but I think I have a little more of an understanding of what’s going on and how it works.
I also caught up a bit on the .Net Rocks podcast on the trip down to my parents’ house and back today for Easter. I’m still about 40 episodes behind. I was (mostly) keeping up for a while, but I started falling behind when they went to twice-weekly. Then, my commute got shorter, which means less time for podcasts in the car. So, the end result is a huge backlog of DNR episodes.

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.