Google Sitemap .NET links

Some links with information about creating a Google Sitemap either directly in XML or via some .NET code.

http://gerardmcgarry.com/blog/creating-a-google-sitemap-aspnet-website

http://www.codeproject.com/KB/aspnet/GoogleSiteMapProvider.aspx

Print Spooler error in Windows 7 (Bootcamp)

I found this blog post, which solved my problem regarding being unable to print on my Windows 7 MacBook Pro 13″ using Bootcamp.

http://tomgee.us/?p=172

This is from the original blog post (thanks to Tom Gee):

——————————————————–

The problem

Today, when I booted directly into my Windows 7 partition (not via VMWare), I noticed that I couldn’t print anything anymore.

I checked the Event Viewer and found the following error in the System log:
The Print Spooler service terminated unexpectedly.

In the Application section of the Event Viewer, I found the following:

Faulting application name: spoolsv.exe, version: 6.1.7600.16385, time stamp: 0×4a5bd3d1
Faulting module name: TPVMMon.dll, version: 2.0.51.5, time stamp: 0×48359080
Exception code: 0xc0000005
Fault offset: 0×000000000000846e
Faulting process id: 0×1300
Faulting application start time: 0×01caa2aa2c4394d8
Faulting application path: C:\Windows\System32\spoolsv.exe
Faulting module path: C:\Windows\System32\TPVMMon.dll
Report Id: 7188e318-0e9d-11df-9123-895fd79b6e49
Faulting application name: spoolsv.exe, version: 6.1.7600.16385, time stamp: 0×4a5bd3d1Faulting module name: TPVMMon.dll, version: 2.0.51.5, time stamp: 0×48359080Exception code: 0xc0000005Fault offset: 0×000000000000846eFaulting process id: 0×1300Faulting application start time: 0×01caa2aa2c4394d8Faulting application path: C:\Windows\System32\spoolsv.exeFaulting module path: C:\Windows\System32\TPVMMon.dllReport Id: 7188e318-0e9d-11df-9123-895fd79b6e49

The only thing I could attribute the Print Spooler issue to was VMWare Fusion.

I tried uninstalling the VMWare Tools program listed in the Control Panel > Uninstall Program section, but it would not remove.

No errors were displayed, but the program wouldn’t remove from the Programs list.

The solution

I deleted the following folder (and all related subkeys) from the Registry (via Start > Run > regedit):

[HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Contro l\Print\Monitors\ThinPrint Print Port Monitor for VMWare]

.NET Resource localization

ResourceBlender is open source and works for .NET:

http://www.resourceblender.com/

IETester 0.4.2

Usually when I need to test a HTML design, I use Spoon browsers… but I saw this IE Tester 0.4.2 tool.

This is just to remind me, don’t install, it made the JavaScript of Gmail and other sites fail.

So, stick to Spoon, don’t use IETester 0.4.2.

Posted in Development, Software. Tags: , . No Comments »

Visual Studio 2008 debugging and breakpoints

My development tools are currently Visual Studio 2008, Resharper 4.5, Gallio and Testdriven.NET. But for as long as I have used these tools, my Visual Studio debugger has only worked partly.

The problem

When I inserted some breakpoints in my code, the first one was almost all the time hit. However, when I tried to step through the code, it worked fine for a bout 3-6 steps. But then Visual Studio debugger decided that was enough, and just completed the code.

The good thing was, it forced me to write many unit test cases, but sometimes I really think it is nice to visually see the state of your objects, in the code.

I have spoken to colleagues, and tested with different combinations of Gallio, Testdriven.NET and Re-sharper enabled, as I thought they cased the problem. But the debugger just kept bugging me. I had actually given up finding a solution to this problem, thinking that Visual Studio 2010 would fix it.

The solution

So finally, in a complete other context, I stumbled upon this page:

http://code.msdn.microsoft.com/KB957912

And thought…. that title sounds interesting… I quickly moved to the KB article, and started to read. I thought, that sounds exactly as my problem.

With nothing to loose I installed the update, and started to test the debugger… until now it seems to work :)

- please note, I do not use the debugger that often as I write very reliable code :)

Must read and references

Test of online backup providers

I have a Windows server that I use as a development and testing server. Besides that it also hosts my Subversion repository.

Being a developer, my subversion repository is of great value to me. I have therefor been looking for different online backup providers. My requirements are:

  • Must run in a Windows server environment
  • Preferably free or rather cheap
  • Must run autonomously
  • 2-3 GB of space
  • Secure
  • Low frequency of errors

Dropbox

Dropbox provides you with a 2GB free account and works both for Windows and Mac. However it only supports backing/synchronizing one folder.

SugarSync

SugarSync is actually ok and has a nice IPhone app. They provide a 2GB free plan, and I am currently using them in another context. However, they are a bit pricy compared to others.

IDrive

They also provides you with a 2GB free plan. They work alright and have some friendly support people, however their Windows application seems buggy. I have tested the application on 3 different Windows machines, and at first everything works fine… but at some point the software just stops backing up. It seems like the schedule part is broken.

The free plan can also be used on Windows server versions, which is nice.

Mozy

Mozy provides, like the rest, a 2 GB free plan. The software works fine, however not on Windows server versions.

Another thing to note is, if you need to backup a large number of files then Mozy will consume a large portion of you memory accordingly. I have experienced Mozy consuming 400-450 MB of ram.

Memopal

After testing the other providers I found Memopal. They provide a 3GB free account, which is more than the others. Their application runs among others on Mac, Linux and Windows, including a server environment.

As Memopal initially almost satisfies all of my requirements, I was hopeful :) Unfortunately Memopal would not back files up larger than 20MB, as their limit should be 5GB per file, it must be some kind of error with the software. All the smaller files were backup without problems.

As I was backing my Subversion server files up some directories are just called “0″, “1″, “2″ etc. it looks like Memopal does not support these folder names, I was not able to retrieve these folders from their web interface.

Conclusion

So this leaves me with nothing… or I am settling with IDrive and hoping that the errors in the software will be fixed. But I will keep looking for a good and reliable online backup software.

iVPN on Mac OSX 10.4 (Tiger)

iVPN application

I have a Mac mini with Mac OSX 10.4 (Tiger), and I wanted to use this as my home server. Some kind of VPN server was required to give me external access to my files.    

I first read abut iVPN, but I was looking for a free service. I then looked into Hamachi (It looks like LogMeIn har purchased the rights to this software) (HamachiX).    

Hamachi

As I understand it, Hamachi was free and multi platform until LogMeIn took over. LogMeIn currently only support Windows, but I needed both Mac and Windows to work toghether.    

I then got the latest HamachiX and the free LogMeIn Hamachi2 to work, but the connection kept being dropped after some time. I think it is because HamachiX is based on a legacy version of Hamachi, and LogMeIn Hamachi2 is based on a newer version, and as I do not want to keep loosing my VPN connection, I dropped the idea of Hamachi.    

iVPN

Starting from scratch I started to read about other VPN solutions and servers for the client version of Mac OSX. This post explained that a PPTP and L2TP VPN server had been part of all Mac OS since 10.2. It was just not mentioned by Apple nor supported.    

This build in VPN server is what iVPN uses (read more in this post), a configuration tool that until version 2.4 was free, but now is commercialware. But as this tool does nothing but configuration, you can download the 2.4 beta version  here (iVPN 2.4b).    

Configuring the VPN server

As I needed Windows clients to access my Mac mini and due to my current network setup, I chose PPTP as VPN protocol.  The following steps explains what I did to setup the VPN server on Mac OSX 10.4.   

  1. Download iVPN-2.4b  (If you need here is the iVPN 2.4b manual and the iVPN 2.4b source)
  2. Run the iVPN
  3. Click no to the upgrade
  4. Enable the PPTP and disable the L2TP protocol (or enable/disable the protocol you wish to use)
  5. Type in a username and password
    1. Do NOT use spaces in the username…
    2. If you have chosen to use L2TP then write a “shared secret”
  6. Type in a IP address range, but make sure it does not conflict with your existing DHCP server setup.
  7. The router is the default gateway and the subnet mask, normally you would use 255.255.255.0
  8. I used the OpenDNS for DNS resolution.
  9. Check the “Start server at boot time”.
  10. Then click the “On” button.
  11. Type in the administration password if required to.
  12. Close iVPN
iVPN user interface

iVPN application

 

Firewall

Now the VPN server is setup, now you need to open for port 1723 in the firewall.    

  1. Open the System preferences in Mac OSX.
  2. Click “Sharing” under “Internet & network”
  3. Open the “Firewall” tab
  4. Click new
  5. Select other in the “Port name” and write 1723 in the TCP port
  6. As description write PPTP, VPN server or something else
  7. Click ok and then you should be ready Mac OSX wise.

Mac OSX PPTP firewall    

Now the only thing left is to open port 1723 in your router. If you have trouble doing that, look into the manual of your router or call the support hotline of your ISP.

NHibernate Fluent Criteria

– Updated on the 2. January 2010

I have been using NHibernate for some time now, and I am very satisfied with the functionality it provides. However, I do really not like “magic strings” as these makes the code resistent to refactoring.

NHibernate makes use of “magic strings” when doing a query using HQL or the Criteria API. I tend to use the Criteria API as this, opposed to HQL, limits the logic encompassed in “magic strings”.

As I mostly use the Criteria API, I thought, why not do something about it :)  So I did. Very quickly a Fluent Criteria interface was implemented. Here is how it is used:

var email = "email@email.com";
var customerType = CustomerType.Default;

var result = nhSession.Criteria<Customer>()
             .Add.Equals(x => x.Email, email)
             .Add.Equals(x => x.Type, customerType)
             .Order.Desc(x => x.Created)
             .NHCriteria
                 .SetMaxResults(1)
                 .UniqueResult<Customer>();

In this line we call the extension method Criteria with Customer as a generic argument:

var result = nhSession.Criteria<Customer>()

By doing so we of the alternate Fluent Criteria API I have implemented. Currently it is only some of the Restrictions and Order classes that have been implemented, but you are free to use these classes and extend them as you wish.

By calling the NHCriteria property, you get the normal NHibernate criteria API, so here you can set the cache options, max results, etc.

Download the source code here http://ovesen.codeplex.com/wikipage?title=NHibernateFluentCriteria&referringTitle=Home

Happy New Year btw :)

Merry x-mas 2009

No christmas without lolcats :)

funny pictures cat asks for birds

Merry christmas to all. Go here for more lol animals.

Posted in Fun. Tags: , . Comments Off »