A collection of learnings and opinions.

Tuesday, October 14, 2008

Developing ASP pages with Firefox

I prefer Firefox 3 to IE7 when developing (understatement of the week), particularly because it has Firebug and YSlow (an add-on for an add-on, would that be a quasi-add-on?). IE7 has the developer toolbar, but it's not as good (in my experience).
Naturally I have Firefox as my default browser, so when I launch ASP pages in the development server from Visual Studio they open in Firefox. And it is soooo slooooow. It's ridiculous, it's like being on my old 28.8 modem back in the mid-90s.
How can this be? Firefox isn't slower than IE7. That cannot be, no benchmarks point in that direction (OK, those are just javascript, but you get the gist of it).
It turns out the problem is with Firefox 3 and the development server (Cassini). I haven't dug deeply into it, just observed the problem, found the fix and applied it.
I've no time to check it right now, but disabling IPv6 seems a bit ham-handed. It should be possible to just include localhost in the network.dns.ipv4OnlyDomains preference. This is a string containing a comma-separated list of domains.

Technorati Tags: , , , , , , , ,

Tuesday, October 7, 2008

C# Compiler Could Not Be Created

I was having memory-problems on my dev machine (2 Gigs don't go far these days), and after a few resets I was getting an exception whenever I tried to open a solution containing a C# project in VS2005. It told me the C# compiler could not be loaded, and I should reinstall VS.
Eh? No way. That's an entire day, getting it back to where I want it.
So I open the Help -> About to see if I can get some info about what's wrong. There I'm hit by a Package Load Failure, coming from ReSharper (we loves it). This looks like something.
A quick google for this, and I find Aaron Stebner has a possible solution. The tool he references in that post didn't find any problems, but running through the steps to re-build the native libraries did.
So these are the steps in case that blog ever disappears:
  1. Open a cmd prompt
  2. Run del %windir%\Assembly\NativeImages_v2.0.XXXXX_32\Microsoft.VisualStu#
    (where XXXXX is the build number of the .NET Framework 2.0 that
    you have installed - you can figure that out by looking at the name of
    the folder at %windir%\Microsoft.NET\Framework\v2.0.XXXXX)
  3. Run %windir%\Microsoft.NET\Framework\v2.0.XXXXX\ngen.exe update /queue
That's done it. A restart of VS and we're up and running again. Now I just have to convince my boss I should get 2 more gigs of RAM.

Wednesday, October 1, 2008

Personal Information Numbers

A quick set of Regexes to check for Personal Information Numbers from the nordic countries.
I use these to check the format only, no fancy calculation of checksums etc.

  • Norwegian: DDMMYYXXXXX

  • Swedish: YYMMDDCXXXX (C == '-' || '+')

  • Danish: DDMMYY-XXXX

  • Finnish: DDMMYYCZZZQ (C == '-'||'+'||'A' ; Q == [01234536789ABCDEFHJKLMNPRSTUVWXY])

  • Icelandic: DDMMYY-XXXC (C == 0 || 9)