1/30/2009

ASP.NET MVC RC - “REFRESH” OUT

If you are getting into the RC1 Release of ASP.NET MVC – you might want to check this post by Phil Haack – which apparently corrects a couple of problems and provides a corrected download.

I have to keep synced with this now because we’re starting a major new project with a client that is already using MVC – and so I need to be able to jump in with both feet.

Here is the link to the direct download to the revised installer.

And here is a link to Haack’s post about the “refresh”. Phil says that the way to fully ensure you have the refresh is to right click on the downloaded file, select the Digital Signatures tab, and make sure the Time Stamp says Wednesday, January 28 and not Friday, January 23.

Kindly note that the link to the “release documentation” with the new installer now links to a real Word document with all the details for your reading pleasure.

Well! Let’s get going and hope there aren’t any more “hiccups”!

1/28/2009

Which Antivirus for Windows 7?

The list of “compatible” antivirus programs for Windows 7 is short – Norton, Kaspersky, Avira, and AVG.

I tried Kaspersky 8 Beta first, but after a couple of weeks I’ve determined that it’s just too bulky and “obtrusive” and has some issues that I’m not happy about.  Recently I uninstalled this (thankfully, the uninstall was very clean and left no traces) and tried AVG Free.

AVG free boasts some 80 million users, is MUCH more lightweight, and at this point this is the one I recommend for Windows 7. For a “free” version – this thing has way more features than you’d expect.

Since my Avast! license recently expired on my main development machine that runs Windows Vista x64, I installed AVG Free on that too. It found and eliminated nearly half a dozen known threats that Avast! never was able to find.  The only option that is disabled that I could find on AVG Free was the rootkit scan. F-Secure has a free FSBL.EXE scanner to take care of that, so the “free” antivirus option is indeed alive and well.

Furthermore, with AVG running and all of its components fully enabled, Windows 7 runs on my notebook computer in only 653MB of RAM! And that’s with SQL Server 2008 and a whole bunch of other services running. Microsoft got this one right!  Once I figured out how to get the “Send Feedback” links off all the windows and get rid of the desktop watermark in the right lower corner, it doesn’t act like a BETA to me!

Oh, and did I say “Free”?

You can get your copy of AVG free here.

1/27/2009

Windows 7: How to remove “Send Feedback” links from all windows

Windows 7 Beta build 7000 has a “Send Feedback” link at top right of every window title bar. That’s fine, I’m happy to send feedback, but the problem is I’ve found I have been accidentally clicking these links and it’s gotten to be a real annoyance. Here’s how to remove the little buggers:

 

1. Run regedit.

2. Navigate to the key: HKEY_CURRENT_USER\Control Panel\Desktop.

3. Check to see if you already have a key (in the right pane) “FeedbackToolEnabled”. If so, set its value to 0.

3. If you do not have this key, then  right-click on the right pane and select New -> DWORD (32-bit) value. Name the new value FeedbackToolEnabled and set it's value to 0.

4. Restart your machine.

All of the "Send Feedback"  links will now be gone from the Windows 7 title bars.

1/24/2009

NHibernate: More on Top-Down, Objects First Development

“I'm thirty years old, but I read at the thirty-four-year-old level.”  - Dana Carvey

Recently I participated in a Twittervation (“Twitter conversation”?) that started with a respected friend, who is a very well-known MVP, book author, and article writer, complaining that Entity Framework was a “pain in the ass”. That was “out of the blue”, it wasn’t in response to somebody else’s tweet.

Of course, I felt compelled to respond and tweeted, “NHibernate. Also PITA, but without all the MS data-centric baggage. (Just my 2 cents)”. Almost simultaneously, another MVP friend of mine who has a follower relationship with the first Tweeter and me said, “why not use NHibernate?”.

Subsequent Tweets revolved around “Don't get me wrong, not saying you shouldn't use it or that you're wrong for doing so. Just asking if you've seen NH”, and my ending with “I did a lot of research, man. It was painful. NHibernate won. End of story.”

Why did I say this?

I have no beef with LINQ To SQL. It works great, I’ve used it, and it is very easy to learn.  I’ll continue to use it where appropriate. You can do data access with a greatly reduced number of lines of code. It’s kind of like Typed DataSets on steroids. With Entity Framework, you may have a steeper learning curve (especially since at this writing it is not 100% “baked”), but again the concept is sound.

So what’s the difference?  Recently, Jeremy Miller, an MVP who can be attributed with the original impetus for Fluent.NHibernate, had an article published on MSDN, “Convention over Configuration”. Having an article like this accepted for publication at MSDN Magazine, Microsoft’s flagship developer publication, gives instant credibility to this paradigm, in my opinion. In other words, it’s going to “take off”. The basic concept is to be able to start with your POCO objects. “POCO” means “plain old CLR Object” – in sum, a class that describes a domain entity (e.g. “Customer”, “Product” --you get the idea) but without any “baggage” – e.g., no funky required attributes or decorations in order for it to “work”, no dependencies or required references to other assemblies, and so on. It stands on its own and it is PURE. I repeat – it really is  pure!  You can serialize it over the wire and it will be happy on both ends –- without you having to go through any programmatic contortions.

This isn’t a new concept to me – I wrote about “Contract First” back in 2005.

Next, you need conventions – which involves a series of “sensible defaults” that are built into the programming model. To the uninitiated, these could appear restrictive. But to the developer who understands “how” the programming model works, they provide a tremendous savings in time and efficiency. I’ll explain:

The key with NHibernate is that you can take these POCO’s (assuming they’re created with some sensible defaults)  and ask NHibernate to map them. The NHibernate infrastructure will create “[POCOName].xbm.xml” mapping files that NHibernate can use to build the DDL SQL that creates your database schema.  So you can create your domain model first –- the way it should be -- and from that,  create the schema for the persistence mechanism.  But, it gets better: The Fluent.NHibernate “Automapping” features mean that you can build this Infrastructure in memory via reflection without the need for any XML at all. The Automapping classes allow for “sensible defaults” that cover the majority of cases and still permit you to override these (perhaps your table names in the database are slightly different, or your primary key naming convention isn’t exactly the same, etc.) and allow you to get what you want.  LINQ to SQL and Entity Framework become quite clumsy when you try to use them with this paradigm. And, unhappily, I believe it is unlikely they will change much going forward as they’re already kind of “baked” into Microsoft’s data-centric approach  -- which really centers on having the database schema first, and the classes / entities coming from that.

The Fluent approach, which in a nutshell just means that every method returns an instance of the class, allows you to do much more intuitive programming along the concept of “DoThis().WithThat().ButAllowThis().Abracadabra(param)  --- and so on. Should you need to make changes to your domain model (which is often the case during development) you can run the automapping again to keep your persistence schema right in sync.

James Gregory (one of the active contributors to the Fluent.NHibernate project) has a wonderful set of blog posts that really bring this home. I hope you’ll read them, as well as the Google Group for same, which is starting to attract a nice following and some great contributions that are sure to make you “think outside the box”.  I’m having fun with Fluent.NHibernate. As with any learning curve, it may be somewhat painful at first. But you know what? I got religion on this, man. It works! Take the time, and it can work for you to. You’ll thank me later.

1/20/2009

What is Fiscal Responsibility?

We have a new Administration.  We have a number of States who can’t seem to balance their budgets. 

Here’s the deal: I balance my checkbook. I have no choice: if the money isn’t there, I don’t have the luxury of some sort of fiscal “chicanery”. The money is either there, or it isn’t.

Most state legislatures’ budgets specify the same:  “If the revenue isn’t there, we cannot spend it”.

But, they seem to think that they are exempt from the checkbook algorithm for some reason. States are running up deficits, and now they want Uncle Sam to bail them out (along with all the other “bailout” suitors)

They are not to be allowed! You don’t go to the Federal Government to allocate taxpayer revenue to “fix your problem”. What you do is to have a plan that enables your state to assess its revenues and adjust the budget to become deficit-neutral.

Just like you and I  do every month with our checking accounts.

What am I talking here, Greek?

Lets get our financial houses together and stop the bullshit, both in State Congresses and Federal Bodies.

You want to have a balanced budget? Then go ahead and  balance it, you fyookin’ morons! 

We’re on track for a multi-trillion dollar deficit with this BULLSHIT! 

Who do we think we’re kidding?

THERE IS NO SUCH THING AS A FREE LUNCH.

Somebody has to pay.

Fix  it now, or wait till later.

Its a lot less painful to fix it now.

1/10/2009

Windows 7 Beta Upgrade Experience

“You can't wait for inspiration. You have to go after it with a club.”   - Jack London

After doing quite a bit of reading to check up on various potential issues regarding the installation of the Windows 7 public Beta (build 7000),  and after having run it for a bit inside a VM,I decided it would be OK to do an upgrade over my notebook’s Windows Vista Ultimate installation.

I use this machine often, but it is not my primary development box, so if things went south, it wouldn’t hurt me too much.

The upgrade process was interrupted the first and second times by “incompatible software”. The first was Windows Powershell – which is installed by SQL Server 2008.

There is no obvious way to uninstall this, so what I did was to rename the powershell folder under the Windows\System32 folder, and then search for the registry entries and set the installed key from “1” to “0”. That took care of the first offender.

The next interruption came when Windows 7 told me Raxco PerfectDisk was incompatible. Well, I haven’t used PerfectDisk for quite a while, and it wasn’t actually installed. However, there remained installation files and more Registry entries that had to be removed.  Finally, Windows 7 was happy and it continued.

The upgrade process from that point on was uneventful – it just took a very long time (over 3 hours as I recall). Of course my Twitter brethren advised me to “pave” – but I know from experience that waiting 3+ hours for an upgrade vs. reinstalling all my “Stuff” was not feasible – it would have taken me 3 days.

Once Windows 7 was up and running, I had to disable UAC because it was preventing some “stuff” from loading or working (Russinovich’s Process Explorer for one, and ERUNT for another). But once I got that taken care of everything was great. Then I downloaded and installed Kaspersky Antivirus 8 beta, which is promoted as being Windows 7 compatible. Incidentally, if you use this or similar antivirus programs that have anti-spyware built in, you want to disable the Windows Defender service as you don’t need “double protection”.

There were a couple of other minor glitches with various proggies but some sensible tinkering fixed them. For example, it reported that the Synaptics touchpad driver was incompatible, but I chose “run anyway” and it works fine.

Otherwise, I’m happy to report that all of my “Stuff” – Visual Studio, SQL Server 2008, Expression Blend 2 and a host of other programs all work great. The best thing about WIndows 7 on a notebook is the low memory footprint. With Vista, I was looking at anywhere from 1.2 GB up – Looking at the “Memory” graph in Windows 7, it’s only using 763 MB.  Battery life should also improve, according to what I’ve read.  (Actually, I just looked at the Memory graph again and it’s only 695MB – truly amazing).

There are some interesting improvements in Windows 7 some of which, like Media Foundation, that were only partly supported in Windows Vista. Additionally, IE 8.0 seems to render web sites in a more forgiving manner than previous Internet Explorer betas- a good thing.

So, should you install Windows 7 on a non-critical machine? Based on my experience, I’d say yes – as long as you’re prepared to fix some annoying glitches and know what to do. While this *Is* a BETA, I can state from long experience with Microsoft offerings that it is a lot farther advanced down the road than the typical BETA 1 offering. I predict that Windows 7 will be a real success – either as an upgrade to Windows XP (which is not allowed in this Beta) , or to Windows Vista (which is allowed).